ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

RAG Colors

apathetichell
13 - Pulsar

the logic there works - assuming:

 

a) that status is already populated.

b) that you want Blue to trump all other colors

c) an empty field is preferable to some kind of base color.

 

in a formula you'd have to be clear that you are modifying "final color" and not entering a new field.

DigitMac
8 - Asteroid

@danilang @apathetichell 

 

Thanks..but in my use case this fails since I have to ensure that 2 combinations of the colors are to be marked

 

if contains([Concat_Color],"Blue") then
'Green'
elseif contains([Concat_Color],"Amber") then
'Amber'
elseif contains([Concat_Color],"Red") then
'Red'
else
""
endif

 

 

Conditions :

BLUE = No Red, No Amber, No Green
RED = Red
AMBER = Red, Amber
GREEN = Red, Amber,Green

 

Please advise based on the conditions...thanks !

 

apathetichell
13 - Pulsar

@DigitMacYou should be able to get what you want by a simple edits to @danilang 's workflow.

 

Open up his formula - and swap out the first color tested from "Blue" to "Green" and then change the final else from "" to "Blue"

 

if contains([Concat_Color],"Green") then
'Green'
elseif contains([Concat_Color],"Amber") then
'Amber'
elseif contains([Concat_Color],"Red") then
'Red'
else
"Blue"
endif

 

This is what I was asking about yesterday in terms of color dominance - it sets "Blue" as the absence of other colors and "Green" as the dominant color.

 

 

DigitMac
8 - Asteroid

Hi @apathetichell @danilang 

 

What helped was a combination :

 

Step 1:

I created a calculation after summerize as indicated with below logic

 

LEFT([Concat_Color],15)

 

Step 2 :

if [Concat_Color] ="Red,Amber" then
'Amber'
elseif [Concat_Color] = "Red,Amber,Green" then
'Green'
elseif contains([Concat_Color],"Red") then
'Red'
else
[Concat_Color]
endif

 

By doing this I could exactly select 15 characters and the combinations work well for my dataset 😀

 

Thanks for your support and this worked !

Labels