Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous and Current month comparisons

Hi,

I want to perform the following on Qlikview:

on the data set I have a field 'class' that holds two outcomes 'legal' and 'not legal'

I want to sum the total amount when:

- in the previous month, the accountNumber's class was 'not legal'

- and current month, the accountNumber's class is 'legal'

meaning i want to sum total amount for only the accountNumbers that have transitioned from not legal (in the previous month) to legal (current month)

Your help will be highly appreciated.

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Please don't clutter this site with duplicate discussions: Previous and Current Month data comparison

Try this expression if your month field contains numeric month values:

sum({<Month={"$(=max(Month))"},class={'legal'},accountNumber=P({<Month={"$(=max(Month)-1)"},class={'not legal'}>}accountNumber) >}amount)


talk is cheap, supply exceeds demand