Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
gunjesh0310
Contributor II
Contributor II

If condition is not working for Year,Month,Quarter,Day in calculated dimension

Hi,

I am facing issue while creating calculated dimension with IF condition.

I have list box for Year,Month, Quarter,Day and I need to create If statement like below.

Nested If with Year,Month,Quarter,Day and we are not having Date column.

1. if (date<'01-jul-2018',1),If(date>'01-Jul-2018',2)

All the dashboard working on selection of Year,Quarter,Month and Day.

I am trying somethin like =if(Month and year<= 'Jul' and 2018,1,0). This is not working.

Please help.

Regards,

Gunjesh Joshi

5 Replies
sunny_talwar

Do you have a MonthYear field? May be do like this

=if(MonthYear <= MakeDate(2018, 7), 1, 0)

gunjesh0310
Contributor II
Contributor II
Author

hi,

Thanks for reply,But I am not having MonthYear together,they are different field.

regards,

Gunjesh Joshi

gunjesh0310
Contributor II
Contributor II
Author

Hi,

I had tried,But it is not working.

7 is Jul in my data model and not number it is text.(i.e. Jul)

Regards,

Gunjesh Joshi

sunny_talwar

May be do this then

If(Date#(Month & '-' & Year, 'MMM-YYYY') <= MakeDate(2018, 7), 1, 0)

gunjesh0310
Contributor II
Contributor II
Author

Hi Sunny,

It work:). Thanks for helping.

Regards,

Gunjesh Joshi