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

How to make 3 conditionals (Getcurrentfield)?

Hi everyone, I have a question. I have a chart that depending the dimension Im showing it has its own unique set of colors. I was able to do this till two conditionals. Can someone please help to add a third one (Resources) when if its not one of the two conditionals that i have use the default set of qlik colors?

This is my expression that works perfect for two conditions:

=If(GetCurrentField(Forecast)='Area',(IF(Area='DRIVE',vAreaColorBlue, 

       IF(Area='FIN', vAreaColorlightblue,

          IF(Area='GX', vAreaColorCelestial, 

            IF(Area='HBG', vAreaColorWhite, 

            IF(Area='N/A', vAreaColorBeige,

            IF(Area='IT' , vAreaColorBeige,

            IF(Area='OE & BD', vAreaColorLightGrey,

            IF(Area='REGIONS', vAreaColorDarkGray,

            IF(Area='S&M', vAreaColorBlack,

            IF(Area='HR', vAreaColorSand,

              vCorporateColor_Red ))))))))))),(IF(ACCOUNT_TYPE='Project',vCorporateColor_Blue, 

       IF(ACCOUNT_TYPE='Change Request', vCorporateColor_Green,

          IF(ACCOUNT_TYPE='Incidents & Maintenance', vCorporateColor_Yellow, 

            IF(ACCOUNT_TYPE='Mgmt & Adm',vCorporateColor_Orange, 

            IF(ACCOUNT_TYPE='Project Proposal',vCorporateColor_Gray

              ,vCorporateColor_Red )))))))

I found out how to get the default set of colors with this Expression: If(GetCurrentField(Forecast)='Resources',''

But then again my problem its how to add this third conditional?

Thank you for your time,

Pablo

1 Solution

Accepted Solutions
sunny_talwar

May be you need to simplify what you have today

=If(GetCurrentField(Forecast)='Area',

Pick(Match(Area, 'DRIVE', 'FIN', 'GX', 'HBG', 'N/A', 'IT', 'OE & BD', 'REGIONS', 'S&M', 'HR') + 1,

vCorporateColor_Red,

vAreaColorBlue,

vAreaColorlightblue,

vAreaColorCelestial,

vAreaColorWhite,

vAreaColorBeige,

vAreaColorBeige,

vAreaColorLightGrey,

vAreaColorBlack,

vAreaColorSand),

If(GetCurrentField(Forecast)='ACCOUNT_TYPE',

Pick(Match(ACCOUNT_TYPE, 'Project', 'Change Request', 'Incidents & Maintenance', 'Mgmt & Adm', 'Project Proposal') + 1

vCorporateColor_Red,

vCorporateColor_Blue,

vCorporateColor_Green,

vCorporateColor_Yellow,

vCorporateColor_Orange,

vCorporateColor_Gray),


If(GetCurrentField(Forecast) = 'Resources',

Pick(Match, ......) + 1

...

...

...))))

View solution in original post

2 Replies
sunny_talwar

May be you need to simplify what you have today

=If(GetCurrentField(Forecast)='Area',

Pick(Match(Area, 'DRIVE', 'FIN', 'GX', 'HBG', 'N/A', 'IT', 'OE & BD', 'REGIONS', 'S&M', 'HR') + 1,

vCorporateColor_Red,

vAreaColorBlue,

vAreaColorlightblue,

vAreaColorCelestial,

vAreaColorWhite,

vAreaColorBeige,

vAreaColorBeige,

vAreaColorLightGrey,

vAreaColorBlack,

vAreaColorSand),

If(GetCurrentField(Forecast)='ACCOUNT_TYPE',

Pick(Match(ACCOUNT_TYPE, 'Project', 'Change Request', 'Incidents & Maintenance', 'Mgmt & Adm', 'Project Proposal') + 1

vCorporateColor_Red,

vCorporateColor_Blue,

vCorporateColor_Green,

vCorporateColor_Yellow,

vCorporateColor_Orange,

vCorporateColor_Gray),


If(GetCurrentField(Forecast) = 'Resources',

Pick(Match, ......) + 1

...

...

...))))

pablomind
Creator
Creator
Author

Thank you very much for your answer!