Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
taylor_jesse
Creator
Creator

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
sunny_talwar

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
sunny_talwar

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()))

vishsaggi
Champion III
Champion III

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

taylor_jesse
Creator
Creator
Author

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

taylor_jesse
Creator
Creator
Author

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

Thank you

sunny_talwar

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...

taylor_jesse
Creator
Creator
Author

Make sense.

Thanks alot Sunny