Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Selection returns different results

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.

Capture1.PNG

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.

Capture2.PNG

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.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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

http://masterssummit.com

http://qlikviewcookbook.com

http://www.easyqlik.com

View solution in original post

6 Replies
trdandamudi
Master II
Master II

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);

rubenmarin

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])

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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

http://masterssummit.com

http://qlikviewcookbook.com

http://www.easyqlik.com

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

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.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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