Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date format in set analysis

Hi Guys,

Currently I have a set analysis selecting dates in a expression e.g.

Count({$<DateStart_User = {">=$(=Date(MonthStart(Addmonths(Today(),-1))))"}>} Employee)

and I have a date expression so that my chart can give data over MMYYYY format:

=Date(MonthStart(DateStart_User), 'MMYYYY')

My question is, is there a way I can force the 'MMYYYY' format in my set analysis expression, so that I can only use DateStart_User as a Dimension?

Please advise, and thanks in advance.

W

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think I haven't fully understood your issue, but maybe it's a good start to create a field in the data model:

LOAD

     DateStart_User,

     Date(MonthStart(DateStart_User), 'MMYYYY') as MonthStart_User,

...


Then you can use this field as dimension, and in your set expression


Count({$<MonthStart_User = {">=$(=Date(MonthStart(Addmonths(Today(),-1))),'MMYYYY')}>} Employee)

View solution in original post

3 Replies
swuehl
MVP
MVP

I think I haven't fully understood your issue, but maybe it's a good start to create a field in the data model:

LOAD

     DateStart_User,

     Date(MonthStart(DateStart_User), 'MMYYYY') as MonthStart_User,

...


Then you can use this field as dimension, and in your set expression


Count({$<MonthStart_User = {">=$(=Date(MonthStart(Addmonths(Today(),-1))),'MMYYYY')}>} Employee)

Anonymous
Not applicable
Author

You can do while loading your data in script:

date(DateStart_User,'MMYYYY') as DateStart_User;

and then In expression you can simply use:

Count({$<DateStart_User= {">=$(=Date(MonthStart(Addmonths(Today(),-1))),'MMYYYY')}>} Employee)

Not applicable
Author

Thank you.