Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

swati_rastogi27
Contributor

Chart colors based on calculated dimension value

Hi folks ,

This is wrt a bar chart I am looking at.

I have a calculated dimension as :

=if(EOLDate = ' ', 'Current', if(DateSelected < EOLDate, 'Current', if(DateSelected < EOVSDate, 'EOL', 'EOVS')))

The expression is :

=Count(if(EOLDate = ' ', 'Current', if(DateSelected < EOLDate, 'Current', if(DateSelected < EOVSDate, 'EOL', 'EOVS'))))

In my graph , i have 3 bars , 1 for Current , 1 for EOL and 1 for EOVS

I want these colors for the bars :

'Current' -> Green

'EOL' -> Yellow

'EOVS' -> Red

Unable to do that.

Please help

Tags (1)
5 Replies
Partner
Partner

Re: Chart colors based on calculated dimension value

I would suggest to create 3 Measures in Master for Current, EOL, EOVS.

There you can directly assign colors.

Else try,

if(EOLDate = ' ', red(), if(DateSelected < EOLDate, red(), if(DateSelected < EOVSDate,green(), yellow())))

Highlighted
swati_rastogi27
Contributor

Re: Chart colors based on calculated dimension value

This expression is not working. It assigns Yellow to all the 3 bars

if(EOLDate = ' ', red(), if(DateSelected < EOLDate, red(), if(DateSelected < EOVSDate,green(), yellow())))

balabhaskarqlik
Honored Contributor

Re: Chart colors based on calculated dimension value

Try this, in your Background Color area of the expression:

=if(IsNull(EOLDate) OR (DateSelected < EOLDate), Green(), if(DateSelected < EOVSDate, Yellow(), Red()))

swati_rastogi27
Contributor

Re: Chart colors based on calculated dimension value

Unfortunately this is setting all 3 bars to green

vishsaggi
Esteemed Contributor III

Re: Chart colors based on calculated dimension value

Try this?

=if(Len(Trim(EOLDate)) = 0 OR DateSelected < EOLDate, red(), 

   if(DateSelected < EOVSDate, green(), yellow()))