Alteryx Designer Desktop Discussions

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

Round of alternate rows differently if headers keeps changing

sanchit
7 - Meteor

Hi everyone, can anyone help me in a logic to format rows rather than doing it by columns as columns names are dynamic and will keep changing , Anyway to format alternate rows no matter what is the column header

 

today they are home, office, tommrow it can be tables,chairs. So headers are not fixed, any way to do this??

 

CategoryHomeOffice
Sales100.9200.9
Ratio0.000020.00004
Profit200.9300.9
Ratio0.000050.00004
9 REPLIES 9
binuacs
20 - Arcturus

@sanchit you can use the Transpose tool to make it dynamic or one more option is to use the Multi-Field Formula

 

 

binuacs_0-1650954214405.png

 

flying008
14 - Magnetar

Hi,@sanchit 

 

please see that.

 

录制_2022_04_26_15_05_45_194.gif

 

sanchit
7 - Meteor

@flying008 and @binuacs  In both the cases everything is formatted to two decimals, Ratios needs to be 5 decimal places and Sales 1 decimal accurate

flying008
14 - Magnetar

Hi,@sanchit 

 

I'm already edited my post, please see above gif, maybe you need change the Output Type to Double of Multi-Field Formula tool. 

sanchit
7 - Meteor

@flying008 can you share the packaged flow Please

flying008
14 - Magnetar

@sanchit 

 

1- the input data:

 

CategoryHomeOffice
Sales100.9200.9
Ratio0.000020.00004
Profit200.9300.9
Ratio0.000050.00004
Sales100.260.123456
Ratio10.256790.123456

 

2- the Expression of Multi-Field Formula:

 

 

Switch([Category],[_CurrentField_],"Sales",Round([_CurrentField_], 0.1),"Ratio",Round([_CurrentField_], 0.00001))

 

 

 

3- You need Change Output Type to "Double" after select the option for all "numeric" Fields.

binuacs
20 - Arcturus

@sanchit in that case you need to add a conditional check in the formula tool

 

binuacs_0-1650958404029.png

 

sanchit
7 - Meteor

Thank you, this is a better solution rather than transposing the data twice and can be accomplished in just one step. 

 

Accepting this as the best solution

sanchit
7 - Meteor

Thank you for taking time and wokring on this, this is also a acceptable solution but I would personally prefer the other one as it uses less steps.

Labels