faush: First start by creating a Running Total (caact1_rt) which sums CAACT1 but evaluates according to the formula CAACT1 = 1000.
Then your original formula will read:
If CAFNCT = 0 and CACMPY in 102 to 199 then caact1_rt else 0
Note thst this will return the Grand Sum of CAACT1. If you need subtotals then you will need to choose a reset for the Running Total David C. Monks
david.monks@chase-international.com
Thanks for responding. Still working on this formula, and now I need it to do something slightly differently
The value I need to show up on my report is the sum of fields CACA01 to CACA13 - these fields each represents a month and contains the balance for that particular month.
However, I need to print that total only if the conditions above it are true.
The formula does not have any errors, but I'm not getting any numeric value after I run this. If I browse the field data, the correct data does show up. How do I get this to print? I thought this was a simple formula, but I guess I keep missing something. Thanks so much for your time on this never-ending problem.
The following fields are all numeric values and represents account number, department, etc.
if (CHART.CAACT1} = "1000" and {CHART.CAFNCT} = "00"
and {CHART.CACMPY} = "1" and {CHART.CAFND1} = "01"
faush: The problem is that your formula is evaluated for each record. If it so happens that your conditions are not met then the default reponse will be zero rather than what I expect you are looking for which is for the continuation of the previous sum.
Try defining your formula as follows:
numbervar annual := 0;
annual := if (CHART.CAACT1} = "1000" and {CHART.CAFNCT} = "00"
and {CHART.CACMPY} = "1" and {CHART.CAFND1} = "01"
But I'm still getting a zero value. I did a query on this, and there is an amount in CACA03 that should be displayed after the formula runs. Any further suggestions would be extremely helpful.
faush: The zero response means that you IF test is evaluating false. Check this by doing 1 of 2 things.
1. Create another formula which just contains the IF test i.e.(CHART.CAACT1} = "1000" and {CHART.CAFNCT} = "00"
and {CHART.CACMPY} = "1" and {CHART.CAFND1} = "01"
Place this on your report and check that you are getting True responses when you expect them
2. Trim your strings to remove any spurious characters as in :
numbervar annual := 0;
annual := if trim((CHART.CAACT1}) = "1000" and trim({CHART.CAFNCT}) = "00"
and trim({CHART.CACMPY}) = "1" and trim({CHART.CAFND1}) = "01"
You may find it easier if (CHART.CAACT1},{CHART.CAFNCT},{CHART.CACMPY},{CHART.CAFND1} will only contain numeric charcters to convert the whole thing to use numerics as in:
numbervar annual := 0;
annual := if val((CHART.CAACT1}) = 1000 and val({CHART.CAFNCT}) = 0
and val({CHART.CACMPY}) = 1 and val({CHART.CAFND1}) = 1
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.