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: 
Not applicable

Calculating Cross-Dimensional Percentage Changes

Hi guys,

I'm working on a stacked chart displaying yearly revenue data.

So each bar represents the total revenue for a given year and is stacked/built from the revenues of composite businesses in that year. Within the graph, I want to calculate the year-on-year percentage change in total revenues.

I have tried using a code of the form:

=(sum({expression})-above(sum{expression}))/above(sum{expression}).

However, because the data is multidimensional, with "Year" being the larger dimension, the "above()" command doesn't work - instead it calculates the percentage difference between businesses.

Is there a way to construct the code so that qlikview overrides (or ignores) the business dimension for the purposes of this calculation only, or should I investigate changes in the expression I am using?

Thanks!!!

1 Reply
swuehl
MVP
MVP

Hi Qlikstarter,

that's quite a challenge for a start

You could maybe use

=aggr((sum(Sales)-above(sum(Sales)))/above(sum(Sales)),Group,Year)

to keep close to your approach using above function.

I think it is working (see attached sample), but using above, the results may depend on sort order.

And using the aggr-function around above, I think the order for above is determined by load order.

Probably there are some other approaches to solve your request, I leave it to others for today.

Hope this helps and have fun,

Stefan