Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I display only negative results in a pivot (past two months)?

I have a pivot and only want to display the results that were less than 0 for the prior two months (Green Highlighted in Image).  I do not want to display where one of the two months was >0 (Red Highlighted in Image).

Bias.jpg

3 Replies
sunny_talwar

Is this in a straight table or Pivot table? Straight table should be simply using

If(Expression1 < 0 or Expression2 < 0, Expression1)

If(Expression1 < 0 or Expression2 < 0, Expression2)

Not applicable
Author

Yes, this will work in straight table, my question was for Pivot where there is only one expression across many dates.

johnw
Champion III
Champion III

Possibly some use of above() or before(), but I hate using chart inter-record functions. I'd add an AsOf table to the data model to be able to reference the previous months. Then you'd end up with some sort of expression like this:

if( sum({<[MonthsBack]={1}>} Blah)<0
and sum({<[MonthsBack]={2}>} Blah)<0
,   sum({<[MonthsBack]={0}>} Blah))

The As-Of Table