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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

month in text object

hi 

 

i have a month field as_month in database and the format in database is 01-jan-2019 etc etc

so i am tring to extract previous month 

i did this in script 

Month(as_month) as Month_N

and in text box object 

i did this 

max(Month_N) -1 

so when i select jan i did not get dec .. i get sep 

 

how i resolve this 

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

You should rather use date field to get the previous month like:

 

Month(AddMonths(max(as_month), -1) )

 This way, you could even get previous month from last year. However, if you use only month field, you might not easily get Dec when you are in Jan.

View solution in original post

1 Reply
tresB
Champion III
Champion III

You should rather use date field to get the previous month like:

 

Month(AddMonths(max(as_month), -1) )

 This way, you could even get previous month from last year. However, if you use only month field, you might not easily get Dec when you are in Jan.