Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Set analysis for LY sales

Hi all,

I have a Variable that sums up the sales. In a pivot table, I have the column with sales, and another one with budget. I would like to bring the sales from last year in the same table as well by using =count({<[Current Year]={$(=Max([Current Year])-1)}>} [Variable]) but this does not return the correct number. Any suggestions?

4 Replies
Highlighted

Re: Set analysis for LY sales

How is your variable looks like?

May be this

=count({<[Current Year]={'$(=Max([Current Year])-1)'}>} [Variable])

or

=count({<[Current Year]={'$(=AddYears(Max([Current Year]),-1))'}>} [Variable])

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Creator III
Creator III

Re: Set analysis for LY sales

the format is =sum({<year={$(=max(year))}>}sales)

Highlighted
Not applicable

Re: Set analysis for LY sales

Thank you for the suggestions but none of them worked actually. Must be a result of the complex variance. I have decided to go for a different option. I created a variable for last year and re-calculated the sales based on this variable (query was slightly amended).

Highlighted
Not applicable

Re: Set analysis for LY sales

Hello Petra,

I almost never write set analysis for date fields. The calendar of the qvc library has the set analysis variables baked in.

It has a highly recommended calendar generator.

,Hannah

PS: Don't forget to mark questions as helpfull or correct .