Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Set analysis in QlikSense - variable help

Hi everyone,

I am transitioning a dashboard from QlikView to QlikSense and a set analysis expression that works perfectly fine in QlikView is not working at all in QlikSense.

Here is the expression from QlikView:

Count({<MonthYear ={">=$(=date(addmonths(date#('$(vYearMonth)','MMM-YYYY'),-11),'MMM-YYYY')) <=$(=date#('$(vYearMonth)','MMM-YYYY'))"}, Year=,Month=>} DISTINCT(ows_ID))

Can someone please help in getting this to work in QlikSense?

Data models between QlikView and QlikSense are exactly the same and the variable is declaring the correct value so I am stumped!!

Thanks in advance

Carl

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Hi,

Make sure you have '=' sign in variable definition.

=date(max(MonthYear),'MMM-YYYY')


Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

8 Replies
Highlighted
Champion II
Champion II

How is your variable vYearMonth defined?

Highlighted
Champion II
Champion II

Also Your MonthYear field looks to be text values

Highlighted
Contributor III
Contributor III

Defined as follows through the Variable Interface screen:

date(max(MonthYear),'MMM-YYYY')

MonthYear is from the Master Calendar.

Highlighted
Partner
Partner

Count({<MonthYear ={">=$(=date(addmonths(date#("$(vYearMonth)",'MMM-YYYY'),-11),'MMM-YYYY')) <=$(=date#("$(vYearMonth)",'MMM-YYYY'))"}, Year=,Month=>} DISTINCT(ows_ID))

Just Try This code . I have just changed the single quotes into "Double quotes". This should probably work. Also make sure the vYearMonth variable is defined.

Highlighted
Contributor III
Contributor III

No luck unfortunately.  Thanks for replying.

Highlighted
MVP & Luminary
MVP & Luminary

Hi,

Make sure you have '=' sign in variable definition.

=date(max(MonthYear),'MMM-YYYY')


Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

Highlighted
Contributor III
Contributor III

Thank you!!!!

Highlighted
MVP & Luminary
MVP & Luminary

Pleasure.

Also keep in mind that whenever you go to variable definition and close that with or without doing changes, the '=' sign gets removed automatically, so make sure in such cases you check if the sign is there or not.

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".