Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
krick
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 (1)
3 Replies
vincent_ardiet_
Specialist
Specialist

I think that you should have a look to previous() or above() function instead.

anat
Master
Master

Below link will help you to get current and previous quarter calculation

https://community.qlik.com/t5/New-to-Qlik-Sense/Current-vs-Previous-Quarter/td-p/1566945

 

Vegar
MVP
MVP

It sounds like you will not be helped by set analysis to solve this. Set analysis modifiers are are equivalent to invisible selections made in the application before performing a calculation, you will not be able to make the modifier dynamic per row.

I second the @vincent_ardiet_ suggestion, to look into the above() function.