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: 
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