Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am new to qlik view and trying to compare Week vs LY Week Comparison in Chart object.
My Data is as below.
in LY Sales column I want sales of Week 1711 , 1712 , 1713 ...?
Week | CY Sales | LY Sales |
1811 | 1000 | ?? |
1812 | 1000 | ?? |
1813 | 1000 | ?? |
1814 | 1000 | ?? |
I am using SET operation to get the same and therea are no altrernate state used here. Can you please help me with hiw to get it.
Expressions I tried here is :
SUM
({$<Week={$(=Only(Week)-1)}>}NetSales)
Try
SUM({<Week = {'$(=Max(Week)-1)'}>}NetSales)
Is it Last Week or Last Year Week?
It need to LY week. T
The solution mentioned below returned data only week 1813 Row
and the number in the LY column was for the same week (1813).
This is not I am expecting to be. The number in the LY column should be week 1812.
Rahul...
Analyze the functions above and below!
hi
have a look at the attach example
the method is to use year field to move a year back
and a week field that holds the same number each year
than using a aggr function you get what you want
Hi ,
I tried what is mentioned below and different option.
SUM({<Week_No = {'$(=(Week_No)-1)'}>}NetSales) -- returs all records as 0
SUM({<Week_No = {'$(=Only(Week_No)-1)'}>}NetSales) -- returs all records as 0
SUM({<Week_No = {'$(=MAX(Week_No)-100)'}>}NetSales) -- returns only for the week row with week 1713 and the data is for the week LY 1713 week only .
Ideal scenario data should be agaist row with week No 1813 and LY column in row 1813 should have data of 1713.
My base data is at week grain.
hi you cant use the set analysis on the week field as it returns for all rows the data from the max week
in your case 1813
you need to use the year field if you have one or create one in the script
i've attached an example in another post in this thread have a look at it
Thank you all your inputs helped me understand set and yes my probelm was solved too.