# QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Contributor

## Above, Before - Stacked Bar Year on Year Change

Hi,

I'm trying to chart the year on year change in value for different values of a dimension. I can do this in  Pivot table using the Before function, I can do it year on year for the overall sum of values, by removing the dimension and using the Above function. But I can't get it working in a chart with the dimension included.

Here's an example qlikview file that shows what I'm trying to do and where I'm struggling

Could anyone help?

Matt

1 Solution

Accepted Solutions
MVP

## Re: Above, Before - Stacked Bar Year on Year Change

You can do this using Aggr() function to change the order of dimensions to get the right context for your above function.

=Only(Aggr(SUM(Value) - above(SUM(Value)),Colour,Year))

To make this work, Year needs to be in chronological LOAD order, if not, you can also use a the sortable aggr() dimensions in latest QV versions:

The sortable Aggr function is finally here!

4 Replies
MVP

## Re: Above, Before - Stacked Bar Year on Year Change

Not quite sure, are you looking for a grouped bar chart?

Contributor

## Re: Above, Before - Stacked Bar Year on Year Change

‌Close, but with the grouping for the legend and axis switched.

So the x axis the Year, the grouping/dimension Colour

And a stacked chart...

MVP

## Re: Above, Before - Stacked Bar Year on Year Change

You can do this using Aggr() function to change the order of dimensions to get the right context for your above function.

=Only(Aggr(SUM(Value) - above(SUM(Value)),Colour,Year))

To make this work, Year needs to be in chronological LOAD order, if not, you can also use a the sortable aggr() dimensions in latest QV versions:

The sortable Aggr function is finally here!

Contributor

## Re: Above, Before - Stacked Bar Year on Year Change

Thank you Stefan - this is great. I shall go and play around with the sortable aggr()

Much appreciated

Matt