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: 
berryandcherry6
Creator III
Creator III

Months Comparison in if condition

Hi,

i have below formula

if(match(Date(MonthStart(today())-1,'MMM')='mar','apr')>0,1,2)

If previous month is mar or apr, i need to display as 1.  But it always displays else part. ie 2.

Whats wromg in my code?

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

if(match(Date(MonthStart(today())-1,'MMM'),'Mar','Apr'),1,2)

View solution in original post

1 Reply
aarkay29
Specialist
Specialist

if(match(Date(MonthStart(today())-1,'MMM'),'Mar','Apr'),1,2)