Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression in Pivot Table

My Pivot table report is somehow looks like

Amount.PNG

To calculate the "Diff " column value I am using the expression

=if (Count ({$<PeriodName={$(=date(addmonths(PeriodName,-1)))}>} Amount) > 0, 1, 0)

Returning "1"or "0" just to check that expression is working fine, but its not working. Even though Amount is there for April, its returning "0" for May month.

Please do suggest where I am doing wrong in expression.

Thanks.

1 Solution

Accepted Solutions
Not applicable
Author

Hi Mayil,

I have tried that also but no success.

Anyways I got the expected result using the expression

=if( ColumnNo( )<>1,sum(Amount) - before(sum([Amount])) , 0 )

View solution in original post

2 Replies
MayilVahanan

hi

use datefield in set analysis..addmonths(periodname,-1) is not datefield...from ur image

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi Mayil,

I have tried that also but no success.

Anyways I got the expected result using the expression

=if( ColumnNo( )<>1,sum(Amount) - before(sum([Amount])) , 0 )