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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
jadams123
Creator
Creator

IF STATEMENT question month

Hi experts:

I want to do this:

IF Month is Jan then blah blah, 

if Month is  Jan + Feb then blah blah. 

When I select Jan it works, but when I select Jan + Feb it doesnt work. Whyyyyy??? and how can I make it work. I even used greater than less than and still doesnt work.  

=if(MonthNum=1,
(if([Region]='Atlantic',0.0022,
if([Region]='Ontario Sw',-0.0882,
if([Region]='Ontario Ce',-0.0882,
if([Region]='Quebec',0.0913,
if([Region]='West',0.0324,0)))))),
if(Monthnum=1 AND MonthNum=2,
(if([Region]='Atlantic',-0.0069,
if([Region]='Ontario Sw',-0.017526,
if([Region]='Ontario Ce',-0.017526,
if([Region]='Quebec',-0.013556,
if([Region]='West',0.016357,0))))))
,0))

Thanks, 

J

Labels (1)
2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try one of these options:

  • =if(MonthNum=1 OR MonthNum=2, ...etc )
  • =if(Match(MonthNum,'1', '2'), ... etc)

talk is cheap, supply exceeds demand
rubenmarin
MVP
MVP

Hi, when asking for a firels, if that field has more than one possible values it will return null(). You need an aggregation funcion that returns one of that many values, ie:
if(Min(MonthNum)=1 AND Max(MonthNum)=2,