Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Converting numbers to date

Hey, I cant get the right value using this expression

=if(Date(mydate,'MMM-YY') = 'Jun-2017',1, 0)

if I select 1 date it will give me the right one, but if select more than 1 it give me zero

The field 'mydate' is in numbers format

7 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The expression will be false if there is more than one date.

-Rob

Anonymous
Not applicable
Author

yes, that's why i am asking what should i do to make it right if there is more than one date selected

arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Mike,

I think you need to create master calendar and calculate monthyear field  then it works if you selected month year then it shows all respective date.

Thanks,

Arvind Patil

passionate
Specialist
Specialist

Hi,

Do you want this in script :

PFA, Solution in Script.

Create a numeric value for date and use this Numeric value in expression.

Regards,

Pankaj

balar025
Creator III
Creator III

Hi,

You can use below function

if(Num(mydate)>=Num(MakeDate(2017,06,01)) and Num(mydate)<=Num(MakeDate(2017,06,30)),1,0)

Regards,

Ravi balar

tresesco
MVP
MVP

May be this?

=Max(if(Date(mydate,'MMM-YY') = 'Jun-2017',1, 0))

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What context do you want to make this test in?  You want it to be true if the date "Jun-2017" exists in the selection?  Or you only want to aggregate rows where that is true?  Is this an expression in a chart or some other expression?

-Rob