jbq Posted October 31, 2009 Posted October 31, 2009 is there a way to write a rule that will add parentheses to financial data instead of the (-)negative? I know excel has the formula, but it is lost in .csv file I see the Negative as Red rule, but that's not what they want. Wondering if anyone has already figured this out. any help is appreciated. Thanks
esmith Posted November 2, 2009 Posted November 2, 2009 Assuming your data includes the minus sign (-) at the beginning of negative values, would the following work? return (Field("Amount").search(/-/)==0) ? "(" + Field("Amount").replace("-","") + ")" : Field("Amount");
jbq Posted November 2, 2009 Author Posted November 2, 2009 Eureka!! :)You are the Guru! It worked great. I got it to work, but I have several FIELDS to apply the rule to. I would like to have one rule ["to rule them all..."] that contains the definition for 12 fields ... do I need to create one rule for each FIELD, or do you have more magic to share. Thanks so much. jbq
esmith Posted November 3, 2009 Posted November 3, 2009 You can either create a separate rule for each field (duplicate rule and update field info) or create a FOR loop to cycle through all fields in one rule (may have to create an array from all the data first). If you choose the latter, the "rule creator" would need to know how the result needs to be formatted first (space/tab/line break between results?).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.