Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Updating records

Pav
7 - Meteor

Hi,

 

I've a dataset below and I would like to update the rows that only have one decimal place e.g. "1.1" "1.2" etc. 

It is based on a RAG status and if any of the records contains a RAG status that is "below" the one in the "main" row it should be updated accordingly.

E.g. if "1.1.2" contains Amber then "1.1" should be updated to Amber.

NumberColour
1.1Green
1.1.1Green
1.1.2Amber
1.1.3Green
1.2Amber
1.2.1Red
1.2.2Green
1.3Amber
1.3.1Red

 

Below is the table with the updated values (rest remains the same) 

1.1Amber
1.2Red
1.3Red

 

Many thanks,

 

Pav

4 REPLIES 4
jdunkerley79
ACE Emeritus
ACE Emeritus

I'd use a RegEx to parse the Number to a one decimal place one and an item

You can then create a priority table converting Red/Amber/Green to 1/2/3

Use a summarise tool to get minimum value for each record.

Then convert back to a colour by joining to the colour table again.

 

2016-07-18_14-10-23.jpg

 

JohnJPS
15 - Aurora

I guess this is identical in logic to that of @jdunkerley79, except it uses formulae instead of parse tools and lookup tables; thought I would post it as just another way to do the same thing.

jdunkerley79
ACE Emeritus
ACE Emeritus

I like @JohnJPS approach as well, one other idea is to use a sort (by NumberOut Asc, ColourInt Desc)  and then a sample (take first 1 for each NumberOut). No need for summarise then

 

2016-07-18_14-44-28.jpg

Pav
7 - Meteor

This is amazing, thank you both. Really helped me here

Labels