Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I have a query regarding Qlik selection.
If I select field in both Year and Month, it only returns the value of that particular month/year. Other month will be equal 0.
But if I select the same from the field Month_Year (created from Year and Month), it will return the desired results of other months also.
As these two ways of selection actually choose the same value of time, it is supposed to return the same. Anyone can explain why the difference?
Thank you.
Your expressions are overriding the Month_Year value in the set expression.
You have a separate expression for month. You can make the chart much easier by using a single expression and dragging the month dim to the top. See attached.
-Rob
Give a try on the below code:
Directory;
LOAD
Date(Date#(Year,'YY'),'YY') as Year,
Date(Date#(Month,'MMM'),'MMM') as Month,
Month,
Client,
Product,
Country,
[Import Value],
[Wholesales/Retail],
Date(Date#(Month&' '&Year,'MMM YY'),'MMM YY') as Month_Year
FROM
Report.xlsx
(ooxml, embedded labels, table is Report);
Hi Vivian, set analisys is set for Month_Year; Year and Month fields will change the results, you can add them to set analysis to ignore selections, ie:
sum({<Month_Year={"$(=date(makedate(max(Year),1),'MMM YY'))"},Year,Month>}[Import Value])
Your expressions are overriding the Month_Year value in the set expression.
You have a separate expression for month. You can make the chart much easier by using a single expression and dragging the month dim to the top. See attached.
-Rob
Hi Rob,
Pardon my question as a novice. Can you kindly specify why my expression is overriding the Month_Year value?
Just to avoid this error for next work. Thank you.
Thanks Ruben. I followed you and got it worked. Sorry the forum does not allow to mark 2 replies as correct, as I tried your solution later.
sum({<Month_Year={"$(=date(makedate(max(Year),1),'MMM YY'))"}>}[Import Value])
You are setting a specific Month_Year value in the expression, which will override your selection.
-Rob