Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Showing results from last year

I have the following table:     

    (The first two columns belong to CAFE and the other two to RESTAURANT)


2011201220112012
Earnings (No taxes)$3,000,000$3,600,000$2,900,000$3,000,000
Earnings (With taxes)$2,300,000$3,000,000$2,500,000$2,550,000
Spent$1,600,000$2,000,000$2,100,000$2,000,000
Benefit$700,000$1,000,000$400,000$550,000

I would like to include three new rows so I can see the benefit last year, the difference in both benefits and the % increase (or decrease).

It would look something like this:                     

(The first two columns belong to CAFE and the other two to RESTAURANT)


2011201220112012
Earnings (No taxes)$3,000,000$3,600,000$2,900,000$3,000,000
Earnings (With taxes)$2,300,000$3,000,000$2,500,000$2,550,000
Spent$1,600,000$2,000,000$2,100,000$2,000,000
Benefit$700,000$1,000,000$400,000$550,000
Last year's benefit                -$700,000                -$400,000
Difference                -$300,000                -$150,000
%increase                -42.86%                -37.5%

The problem I have is that if I can't get to show the benefit from an earlier year in the column from a different year. This example illustrates the problem I'm having.

                                                                                         (The first two columns belong to CAFE and the other two to RESTAURANT)


2011201220112012
sum(<year={'2012'}> Earnings)                -$3,600,000           -$3,000,000

I haven't found a solution yet. If you can think of something please let me know.

12 Replies
IAMDV
Luminary Alumni
Luminary Alumni

You’re welcome. I’ve solved this one in the past. I’ll come back to you with one expression which can be used across multiple dimensions. Hopefully in next two days…

Cheers,

DV

www.QlikShare.com

swuehl
MVP
MVP

What about

=aggr(above(Sum({<Year>}[Earnings (With Taxes)]) - Sum({<Year>}Spent)),Establishment,Year)

as expression for Last Year's Benefit, and then

=Benefit - "Last Year's Benefit"

=(Benefit - "Last Year's Benefit") / "Last Year's Benefit"

for Difference / Percentage?

Regards,

Stefan

IAMDV
Luminary Alumni
Luminary Alumni

Stefan - This is clever stuff. I've tried the Aggr() function but didn't realise that I can use Above(). Totally makes sense.

Thank you.

Cheers,

DV