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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
rido1421
Creator III
Creator III

Creating a Max date with a Text date

Hi There

I have a text date and I would like to create an Expression label showing the previous months name

for my current month its simple just [Month Abbrev] = 'Oct'

now I have a column for the previous months data  and need to create  a label that will be dynamic.

what will the easiest way to create this "[Month Abbrev]-1 " label be?

Thanks in advance

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Dual(Date(Date#(Month,'MMM')-1,'MMM'),Date(Date#(Month,'MMM')-1,'MM')) as PreviousMonth

View solution in original post

5 Replies
MK_QSL
MVP
MVP

Dual(Date(Date#(Month,'MMM')-1,'MMM'),Date(Date#(Month,'MMM')-1,'MM')) as PreviousMonth

its_anandrjs
Champion III
Champion III

Try this

=Month( AddMonths( max([Month Abbrev]) ,-2 ) )

Regards

Anand

rido1421
Creator III
Creator III
Author

Hi Anand

I had tried that expression ... it doesnt seem to work Month Abbrev is a text...  would Max(Month Abbrev) work?

its_anandrjs
Champion III
Champion III

Ok then try this way first convert to the Date format of month

=Month( AddMonths( max(Date#(TextMonth,'MMM')) ,-1 ) )

And

=Month( AddMonths( max(Date(Date#(TextMonth,'MMM'),'MMM')) ,-1 ) )

Regards

Anand

rido1421
Creator III
Creator III
Author

This works great also

Thank you