Jump to content

I am trying to display the difference between credits and de...


Peter Vazny

Recommended Posts

I am trying to display the difference between credits and debits in subfoot in absolute terms. I have a list of transactions which are either credits or debits. I need to add up all the credits and all the debits and show the difference between them without negative sign. ABS(Credits - Debits).

I am aware of ON TABLE RECAP, but that does not seem to be supported by InfoAssist.

EDIT: adjusted title

Link to comment
Share on other sites

So yes, recompute does work. However it does not work for me in this situation. I need to show both the total for volume in transactions (credits plus debits), as well as the absolute value of the difference. I can add additional column to show both, but then I have duplicated data. So really my question should have been how to do absolute value in subfoot.

This is what I would like to see:

01 10.00 C

02 12.00 C

03 15.00 D

04 20.00 D

TOTAL: 47.00

Difference: 13.00

 

This is what the recompute can do for me:

01 10.00 C 10.00

02 12.00 C 12.00

03 15.00 D 15.00

04 20.00 D 20.00

------ ------

TOTAL: 47.00 13.00

Link to comment
Share on other sites

DavidBriars:

 

BY CATEGORY AS 'Category'

RECAP

DR_MINUS_CR/I9C = ABS(DR_UNITS - CR_UNITS);

SUBFOOT

"Total: <ST.UNITS2>"

"Net: <DR_MINUS_CR>"

 

 

 

Interesting. InfoAssist turns it to

BY GGSALES.SALES01.CATEGORY AS 'Category' ON GGSALES.SALES01.CATEGORY RECAP

DR_MINUS_CR/I9C = ABS ( DR_UNITS - CR_UNITS );

ON GGSALES.SALES01.CATEGORY SUBFOOT

"Total: <ST.UNITS2>"

"Net: <DR_MINUS_CR>"

 

So it clearly can parse it, but the DR_MINUS_CR field is not visible anywhere in InfoAssist. It does survive saves and edits. So I guess this is a solution.

Link to comment
Share on other sites

I am sorry @debra.waybright for dismissing your suggestion, but it seems to work. The Column Totals -> Recompute indeed affects report footer. That is very unexpected and I for sure am not able to find any documentation for that. So if on report totals are desired and are to be recomputed instead of just simple that will fix the situation. However there is also a different solution:

COMPUTE DR_MINUS_CR/I9 = ABS(TOT.DR_UNITS - TOT.CR_UNITS); NOPRINT

 

If this computed field is included in the report footer, it will be recomputed and return correct value. According to this blog post, it does not work for subtotals, RECAP will have to be used there instead.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...