Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
gvrodriguess
Contributor
Contributor

How to use Only(Year) when the main dimension is Year already

Hello everybody,.

I have been introduced to the world of Qliksense early this year and there is a case that I cant solve by myself.

So, my goal is to create a table with 3 columns: Year, amount and growth (The diference between year and the year before).

1.PNG

So, no biggie, right? But my ancient ape brain cannot create a function for this damn third column

I've been using the Only() function but with no success.

This is what I'm trying rn:

Sum({<Ano={"=(Only(Ano)-1)"}>}[Qtde KG])

Ano=Year and [Qtde KG] = Amount

Thanks for your time.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can't use Set Analysis to calculate a row by row value for Year.  Set Analysis is executed only once for the chart. What you want to use is Above()

Above(Sum([Qtde KG]))


will give you the Amount from the row above in the chart.


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

http://www.easyqlik.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can't use Set Analysis to calculate a row by row value for Year.  Set Analysis is executed only once for the chart. What you want to use is Above()

Above(Sum([Qtde KG]))


will give you the Amount from the row above in the chart.


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

http://www.easyqlik.com

gvrodriguess
Contributor
Contributor
Author

Thank you!!!

Worked just fine.