Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis for YoY

Hi Experts,

I have data in following format :

YearMonthValue
2013Jul20
2014Jul30
2013Aug60
2014Aug70

I need to use set analysis to display same table in following format :

Month - YearValue CYValue PY
Jul-143020
Aug-147060

How can I achieve the same ?

Thanks,

Sailee

1 Solution

Accepted Solutions
tresesco
MVP
MVP

For multiple years, set analysis would not give you desired result in chart. Better try in the script like:

Input:

load

  *,

  Year&Month as Key;

Load * Inline [

Year, Month, Value

2013, Jul, 20

2014, Jul, 30

2013, Aug, 60

2014, Aug, 70

] ;

Left Join

Load

  Year-1&Month as Key,

  Value as PreYValue

Resident Input;

PFA

View solution in original post

7 Replies
Yousef_Amarneh
Partner - Creator III
Partner - Creator III

Create a variable and name it vCurrentYear and set max(Year) and create another one for last year

create 2 expressions

sum({$<Year={'$(vCurrentYear)'}>} Value)

sum({$<Year={'$(vLastYear)'}>} Value)

and set a calculated dimension Month & '-' & Year

Yousef Amarneh
tresesco
MVP
MVP

For multiple years, set analysis would not give you desired result in chart. Better try in the script like:

Input:

load

  *,

  Year&Month as Key;

Load * Inline [

Year, Month, Value

2013, Jul, 20

2014, Jul, 30

2013, Aug, 60

2014, Aug, 70

] ;

Left Join

Load

  Year-1&Month as Key,

  Value as PreYValue

Resident Input;

PFA

Not applicable
Author

Thanks Yousef. I tried the above, However I get data as shown below. I want Month-Year to show only Month-Current Year and then the columns will have CY and PY data.

Sample_Data.PNG.png

Yousef_Amarneh
Partner - Creator III
Partner - Creator III

ok, set only month in the dimension and select the month that you want

Yousef Amarneh
vadimtsushko
Partner - Creator III
Partner - Creator III

Hi Sailee.

I agree with tresesco you cannot achieve that purely by set analisys but I prefer other solution for such problems.

Look at How to trend Current Sales vs Prev Sales, using date as dimension? I believe requirements there are similiar to your's. Look at discussion there - there are several solutions. My solution there (with a sample application) is in creation of special sort of calendar. Good description of that method is at  Calendar with flags making set analysis so very simple

Not applicable
Author

Thanks tresesco and Vadim Tsushko did at the script level ..

Just have one doubt .. Does preceding loads impact the performance of dashboard ? I do have ample amount of data in the database.

tresesco
MVP
MVP

Yes it does, and does it positively. Preceding load is something that should be used wherever possible rather than resident load.