Hello Everyone,
I'm trying to color cell text in a table using a column rule. If the value in 2 rows is the same i would like the text colored green, if it is different then the text colored red.
I've tried using this formula in the column rules but it just colors everything green : IF [RTO]=[RTO] Then "color:green" Else "color:red" ENDIF
Any assistance would be greatly appreciated.
Thank you!
Solved! Go to Solution.
Hi @EricKlasko,
In your formula you say [RTO] = [RTO]. This checks if the value in a column is itself, which it always will be. What you're trying to say here is like: [RTO]=[RTO-1row] or "are all the values in this column the same?"
If it were me, I would create a "helper column". I would create a new column which is a Count Distinct on the number of values in the column of interest. I would then attach this column back to the main data with a join. You could then reference this column in your Table Rules i.e. if Count Distinct number > 1 then "red" else "green".
Attached an example workflow below, please tailor it to your needs:
My logic, for each city, if the RTO is all the same then green, if the RTO is not then red.
Example of rules
@EricKlasko another way of doing this with the multi-row tool