I have a crosstab with a formula field. The query returns something like
CategoryID Company MarketValue PaymentMode
1 ABC 1000 H
1 xyz 2000 H
3 efg 9800 H
Payment mode is half yearly indicated by ‘H’
I made a formula field to evaluate payment mode by
WhileReadingRecords;
numberVar mode;
if({PaymentMode}='H') then mode:=2 else mode:=12
Then I made another formula field
WhileReadingRecords;
numberVar mode;
numberVar result:={MarketValue}/mod;
result
However it returns division by zero error. Why is my formula for Payment Mode not evaluating properly. I tried placing the payment mode formula in report head and cross tab is 2nd header but it still throws the same error.
Two problems.
First syntax error – or rather typo here, last ‘e’ is missing 🙂
Second – you need to evaluate formuals in specified order. Say your first formula has name ‘calc_mode’, then second one should start with next statement: