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: 
andreas_koehler
Creator II
Creator II

Set analysis in a simple table: How to do refer to chart dimensions?

Hi Guys,

I need to compare annual data and wanted to have a simple table with the sum(Amount) of each year and the sum of last year, while the year is one of the chart dimensions.

I tried to calculate the sum of each last year for each year in the dimension as

sum({$<Year= {"$(=$(Year)-1)"}>} Amount)

It does not work. But why and what would be right solution?

I have attached a small example to your convience.

Thanks,

Andreas

1 Solution

Accepted Solutions
maxgro
MVP
MVP

maybe with this expression

above(sum(Amount))

View solution in original post

9 Replies
maxgro
MVP
MVP

maybe with this expression

above(sum(Amount))

vinieme12
Champion III
Champion III

Rangesum(Sum(Amount),above(sum(Amount)))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
sunny_talwar

Or this if you plan to make selections

Above(Sum({<Year>}Amount)) * Avg(1)

Without Selection

Capture.PNG

With Selection

Capture.PNG

andreas_koehler
Creator II
Creator II
Author

Thanks Massimo,

I had forgotten this expression. Your was the first answer that resolved the initial problem.

Selecting years is a problem though.

Andreas

andreas_koehler
Creator II
Creator II
Author

Thanks Sunny,

Above(Sum({<Year>}Amount)) * Avg(1)

So by adding the "empty expression" of Avg(1), for which the selection"year" is not disregarded, the whole expression becomes filtered by the selection again?

Nice trick.


Thanks

Andreas




sunny_talwar

Yes sir...

andreas_koehler
Creator II
Creator II
Author

Hi Guys,

thanks for all your help.

Please find an updated version of the example with all the answers side-by-side.

sunny_talwar

Are you just compiling and sharing our responses or is there a question for us ?

andreas_koehler
Creator II
Creator II
Author

Just sharing. My attempt to give something back to the community.