Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
taylor_jesse
Contributor

Color expression with multiple conditions

Hi,

I have two columns with color expressions. I want to add a third column to turn green if the other 2 columns turn green. Any help? what i also did was to use the expressions for the two columns but i am getting an error when i use the expressions from the other two columns to set the color expression. Please see below.

=if((num(sum({$<ApplicationStatusCode-={'DUPLAP'}, ApplicationDate={"$(='>=' & Date(MonthStart(Today())) & '<=' & Date(MonthEnd(Today())))"}>} RequestedPartTimeFlag), '##0')>=sum(PTAppGoal)and

(num(sum({$<ApplicationStatusCode-={'DUPLAP'}, ApplicationDate={"$(='>=' & Date(MonthStart(Today())) & '<=' & Date(MonthEnd(Today())))"}>} (RequestedFullTimeFlag-RequestedBothStatus)), '##0')>=sum(FTAppGoal),LightGreen(),Yellow()))

Thank you

1 Solution

Accepted Solutions
Highlighted

Re: Color expression with multiple conditions

May be try this:

=If((Sum({$<ApplicationStatusCode -= {'DUPLAP'}, ApplicationDate = {"$(='>=' & Date(MonthStart(Today())) & '<=' & Date(MonthEnd(Today())))"}>} RequestedPartTimeFlag) >= Sum(PTAppGoal)) and

(Sum({$<ApplicationStatusCode -= {'DUPLAP'}, ApplicationDate = {"$(='>=' & Date(MonthStart(Today())) & '<=' & Date(MonthEnd(Today())))"}>} (RequestedFullTimeFlag-RequestedBothStatus)) >= Sum(FTAppGoal)), LightGreen(), Yellow()))

View solution in original post

6 Replies
Highlighted

Re: Color expression with multiple conditions

May be try this:

=If((Sum({$<ApplicationStatusCode -= {'DUPLAP'}, ApplicationDate = {"$(='>=' & Date(MonthStart(Today())) & '<=' & Date(MonthEnd(Today())))"}>} RequestedPartTimeFlag) >= Sum(PTAppGoal)) and

(Sum({$<ApplicationStatusCode -= {'DUPLAP'}, ApplicationDate = {"$(='>=' & Date(MonthStart(Today())) & '<=' & Date(MonthEnd(Today())))"}>} (RequestedFullTimeFlag-RequestedBothStatus)) >= Sum(FTAppGoal)), LightGreen(), Yellow()))

View solution in original post

Highlighted
vishsaggi
Esteemed Contributor III

Re: Color expression with multiple conditions

Did you try Sunny's expr? If you still have issues can you share a sample file to look into?

Highlighted
taylor_jesse
Contributor

Re: Color expression with multiple conditions

Hi Sunny,

This code worked fine but isn't the number formatting important in this case as it was used in the other columns?

Thank you

Highlighted
taylor_jesse
Contributor

Re: Color expression with multiple conditions

Yes it did work but  isn't the number formatting important in this case as it was used in the other columns?

Thank you

Highlighted

Re: Color expression with multiple conditions

Num() is not needed for if condition because num() is only a formatting function... if you want, you can add it back but it is really not needed. For me, the rule of thumb is... remove functions which are not needed...

Highlighted
taylor_jesse
Contributor

Re: Color expression with multiple conditions

Make sense.

Thanks alot Sunny