Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

tinkerz1
Contributor II

Background colours for dates not working

Hi,

I use the below code to make the date dimension in a pivot table, but the following code for coloring the backgorund for dates only works on the first 2 dates, what could be happening not to color the full selection?

=if(Num([Download Month-Year])>=num(MONTHSTART(Min_Date))  and Num([Download Month-Year])<=num(MONTHEND(Max_Date)),[MonthYear])

 

=if(Num([Download Month-Year])>=num(MONTHSTART(Min_Date)) and Num([Download Month-Year])<=num(MONTHEND(Max_Date)),Yellow())

12 Replies
tyagishaila
Valued Contributor

Re: Background colours for dates not working

could you please share screen shot to know that exactly what happening.

roger_stone
Contributor III

Re: Background colours for dates not working

You have only supplied a colour (yellow) when the IF statement is true, but no colour for false.

tinkerz1
Contributor II

Re: Background colours for dates not working

For information this is the new background code:

 

=if(Num([Download Month-Year])>=num(MONTHSTART(Min_Date)) and Num([Download Month-Year])<=num(MONTHEND(Max_Date)),Yellow(),red())

But the dates stayed white.

balrajahlawat
Esteemed Contributor

Re: Background colours for dates not working

what is the max value of your date field??

roger_stone
Contributor III

Re: Background colours for dates not working

Looking at that screenshot, I think this may have more to do with nulls in your data.

balrajahlawat
Esteemed Contributor

Re: Background colours for dates not working

From your background code, and attached image:

=if(Num([Download Month-Year])>=num(MONTHSTART(Min_Date)) and Num([Download Month-Year])<=num(MONTHEND(Max_Date)),Yellow(),red())


It seems the max value of Date Field is Oct 2015 only, is it??

tinkerz1
Contributor II

Re: Background colours for dates not working

 

=MONTHEND(Max_Date) is 29/02/2016

tyagishaila
Valued Contributor

Re: Background colours for dates not working

you can try it;

right click on dimension --->go to Custom format cell ,

from here you can provide background colour as per your requirement.

tinkerz1
Contributor II

Re: Background colours for dates not working

Thanks but then I will have to do that every time I run a report for a new month