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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
a2ztests
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 the table, according the field YearQuarterKey
 
I tried:
 
=max( {< YearQuarterKey = {"$(=(YearQuarterKey-1))"} >} account_score)
 
It did not work
 
Thanks
Labels (1)
4 Replies
agigliotti
MVP
MVP

Hi @a2ztests ,

Maybe this:

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

I hope it can helps.

Best Regards

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
a2ztests
Contributor
Contributor
Author

Thanks,

I want to show for every row! in the table the previous score so i think comparing it to  

$(=Max(YearQuarterKey)-1)

Will not do what i want.

Any other thoughts?

Thanks again

agigliotti
MVP
MVP

You can try using Above( Sum(account_score) )  if your table is sorted by YearQuarterKey field.
That expression give you the Sum(account_score) of the previous table row.

Best Regards

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
whiteymcaces
Partner - Creator
Partner - Creator