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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Galbatron316
Contributor
Contributor

Get Month number

Greetings:

 

I'm having a problema getting the month number that is today. I have my expression like this:

 

SUM({<[Mes Num]= {'$(=
if(Month(Date(Today()-1))='ene.',1,
if(Month(Date(Today()-1))='feb.',2,
if(Month(Date(Today()-1))='mar.',3,
if(Month(Date(Today()-1))='abr.',4,
if(Month(Date(Today()-1))='may.',5,
if(Month(Date(Today()-1))='jun.',6,
if(Month(Date(Today()-1))='jul.',7,
if(Month(Date(Today()-1))='ago',8,
if(Month(Date(Today()-1))='sep.',9,
if(Month(Date(Today()-1))='oct.',10,
if(Month(Date(Today()-1))='nov.',11
if(Month(Date(Today()-1))='dic.',12)))))))))))))'}
>}Venta)

 

But it doesn't return the month value, it's blank.

 

What's wrong with my expression?

Labels (2)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

the function Month returns dual value.

so you shouldnt need to do the if statements mentioned. you should just need Num(Month(Today()-1))

View solution in original post

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

the function Month returns dual value.

so you shouldnt need to do the if statements mentioned. you should just need Num(Month(Today()-1))

Galbatron316
Contributor
Contributor
Author

Thank you, it worked without issues.

 

Thanks a lot

dplr-rn
Partner - Master III
Partner - Master III

no problems