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: 
etkonwgno
Contributor
Contributor

Using set analysis to get a value of previous period

Hi. I have a dataset with the fields: Account_id, account_score, year_quarter, YearQuarterKey (which is a running sequencial number for every year-quarter combination). I want to use set analysis in a table presentation on my app, and to add the field previous_quarter_score to every row ! in the table, according the field YearQuarterKey

I tried:

=max( {< YearQuarterKey = {"$(=(YearQuarterKey-1))"} >} account_score)

It did not work.

Any thoughts on how to accomplish this?

Thanks

Labels (2)
1 Reply
ajaykakkar93
Specialist III
Specialist III

Hi,

You can follow this way.

create 2 variables min & max dates.

=max( {< DateField = {">=$(vMinQtrDate)<=$(vMaxQtrDate)"} >} account_score)

vMinQtrDate = QuarterStart(min(date))

vMaxQtrDate = QuarterEnd(min(date))

 

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting