Announcements
cancel
Showing results for
Did you mean:
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).

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

1 Solution

Accepted Solutions

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://qlikviewcookbook.com

http://www.easyqlik.com

2 Replies

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