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

Logic requires to update the value in column

alt_tush
9 - Comet

Hi,

 

I have below dataset:

 

NAMEAGEAmountRevenueSaleColumn
SMITH30100100010000Amount
CLARK32200200020000Sale
BLAKE35300300030000Sale
KING48400400040000Revenue
SCOTT43500500050000Amount
MILLER55600600060000Revenue

 

I want additional column "Final Value" as output which gives me the value based on "Column" column, Which contains field name.

Using this fieldname i want to update the "Final Value" column. For example in above table in "Column" filed value is Amnount. So "Final Value" for this entry consider the velue from "Amount" Field. i.e. 100. If Sale then "Final Value" come from sale column.

 

Note : I dont know value in column filed. i mean i dont want to implement logic like if column = 'Amount' then [Amount] if column = 'Sale' then [Sale]. I want to implement the logic in dynamic way.

 

Expected output ( Refer the Final Value column in below table)

 

NAMEAGEAmountRevenueSaleColumnFinal Value
SMITH30100100010000Amount100
CLARK32200200020000Sale20000
BLAKE35300300030000Sale30000
KING48400400040000Revenue4000
SCOTT43500500050000Amount500
MILLER55600600060000Revenue6000

 

Thank you in advance.

4 REPLIES 4
Felipe_Ribeir0
16 - Nebula

Hi @alt_tush 

 

One way of doing this dynamically

 

Felipe_Ribeir0_0-1672680720763.png

 

ArtApa
Alteryx
Alteryx

Hi @alt_tush - Here is one more possible solution: 

ArtApa_0-1672713860359.png

 

alt_tush
9 - Comet

Hello Felipe_Ribeir0,

 

It works. Thank you for your quick assistance :)

alt_tush
9 - Comet

Hello ArtApa,

 

Thank you for your help. This approach is also works.

Labels