Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
grajmca_sgp123
Creator
Creator

how to write multiple if conditions

Hi Qlik Users,

I would like to write below nested if condition up to next 120 months. 

Can any one suggest me to simplify this logic instead of writing 120 times.

If(MDate=MonthStart(Today()),Sales,
If(MDate=MonthStart(Today(),1),Sales,
If(MDate=MonthStart(Today(),2),Sales,
If(MDate=MonthStart(Today(),3),Sales,
If(MDate=MonthStart(Today(),4),Sales,
If(MDate=MonthStart(Today(),5),Sales,
If(MDate=MonthStart(Today(),6),Sales,
.
.
.
.
If(MDate=MonthStart(Today(),120),Sales,

0
)
))))))))))

Labels (1)
1 Reply
Ksrinivasan
Specialist
Specialist

hi,

pl. provide excel sample data

ksrini