Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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
Partner - Champion
Partner - Champion

Hi @a2ztests ,

Maybe this:

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

I hope it can helps.

Best Regards

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
Partner - Champion
Partner - Champion

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