Alteryx Designer Desktop Discussions

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

Extracting different quantities from multiple columns

eleee3
8 - Asteroid

Hi all,

 

I'm trying to extract quantities from a number of columns. An example of my dataset is as follows:

 

ItemSegment Start (km)Segment End (km)Length (m)Width (m)Area (m2)Volume (m3)Client QtyClient Unit
Main St35420000  
Electrical Line 10025000  
Pedestrian Bridge 30001200  
Playground00004000  
Swimming Pool0000012000  

 

And I would like my dataset to look like the following:

 

ItemSegment Start (km)Segment End (km)Length (m)Width (m)Area (m2)Volume (m3)Client QtyClient Unit
Main St354200007km
Electrical Line 1002500025m
Pedestrian Bridge 3000120012m
Playground00004000400m2
Swimming Pool000001200012000m3

 

I've tried using a number of IF statements in formulae to achieve this - for example:

 

IF IsEmpty([Client Qty]) && !IsEmpty([Length]) THEN [Length] ELSE [Client Qty] ENDIF

 

But the outputs into the Client Qty column are always 0.

 

Could someone please help me with this? Note that I cannot upload anything due to my company's restrictions.

 

Thanks in advance!

3 REPLIES 3
mceleavey
17 - Castor
17 - Castor

Hi @eleee3 ,

 

I've achieved this using a couple of methods assumed from your numbers, given the required output does not correspond to the formula you provided (which would only return one value of 25 in one row, even allowing for the fixed syntax).

 

I used a simple formula to determine the Client Quantity, which was (Segment End - Segment Start) plus the sum of all other columns.

 

if IsEmpty([Client Qty]) then ([Segment End (km)]-[Segment Start (km)])+[Length (m)]+[Width (m)]+[Area (m2)]+[Volume (m3)] else [Client Qty] endif

 

I then pivoted the data to pull the unit from the column names using Regex and joined it back.

 

mceleavey_0-1677523954270.png

This gives the following:

 

mceleavey_1-1677523986346.png

 

Workflow attached.

 

I hope this helps,

 

M.

 



Bulien

eleee3
8 - Asteroid

That's great, thanks @mceleavey !

mceleavey
17 - Castor
17 - Castor

no problem.gif



Bulien

Labels