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

Announcements
Register by January 31 for $300 off your Qlik Connect pass: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue with set analysis

Hi all,

I am trying to create a chart that shows a yearly trend and for that I am using set analysis on the year:

sum({$<Year=>}_profit)

/ sum({$<Year=>}_assets)

But I have an issue with creating the correct denominator. In business terms the correct calculation is:

(Assets current year + Assets last year)/2

For the yearly trend this means:

2009: (assets09 + assets08)/2

2010: (assets10 + assets09)/2

2011: (assets11 + assets10)/2

Any ideas, how to set up the expression, so that I can show the yearly trends for above?

Thanks for your help!

1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

If your dimension is year, try using one of the chart inter record functions, above() or below() (depending on your sort order) or before() and after() (if dimension is pivoted in a pivot table):

sum({$<Year=>}_profit)

/ (sum({$<Year=>}_assets) + above(sum({$<Year=>}_assets)) )

View solution in original post

3 Replies
jvitantonio
Specialist III
Specialist III

Use:

(sum({$<Year={'2009'}>}_assets)+sum({$<Year={'2010'}>}_assets))/2

swuehl
Champion III
Champion III

If your dimension is year, try using one of the chart inter record functions, above() or below() (depending on your sort order) or before() and after() (if dimension is pivoted in a pivot table):

sum({$<Year=>}_profit)

/ (sum({$<Year=>}_assets) + above(sum({$<Year=>}_assets)) )

Not applicable
Author

Thanks!