Alteryx Designer Desktop Discussions

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

Create New Data Row by dividing two values from the existing rows.?

kiotsuresh
8 - Asteroid

Hi,

I have Data like below where i need to populate the third row by dividing the values of row 1 and row 2 , Revenue = Profit/Sales, How to achieve this through Alteryx. I need to Populate the Value as well as new name Revenue from the existing data set. 

 

ItemmonthClassificationValueCategoryName
ChairJan - 2022Furniture

50000

Home FurnitureProfit
ChairJan - 2022 Furniture50Home FurnitureSales
ChairJan - 2022 Furniture1000 = 50000/50Home FurnitureRevenue
19 REPLIES 19
ShankerV
17 - Castor

@kiotsuresh 

 

Please let me know if you are looking for the similar result.

 

Step 1: Input the data

ShankerV_0-1669017843710.png

Step 2: Sort, as you might have clumsy data.

 

ShankerV_1-1669017904534.png

 

Step3: Using RecordID to have unique values in each row

ShankerV_2-1669017935568.png

 

 

Step 4:

ShankerV_3-1669017958448.png

 

Step 5:

ShankerV_4-1669017972171.png

 

 

Step 6:

 

ShankerV_5-1669017989070.png

 

Step 7: Union tool

ShankerV_6-1669018013369.png

 

Step 8: Sorting to have formatted output

 

ShankerV_7-1669018035204.png

 

Kindly accept this solution if it provided a solution to your question.

 

Shanker V

 

 

 

 

 

ShankerV
17 - Castor

Hi @kiotsuresh 

 

Please check and let me know if my solution works.

 

Many thanks

Shanker V

kiotsuresh
8 - Asteroid

Hi DenisZ,

The Entire Third row I need to derive from the other two rows, In You input there is a row added revenue, Below will be the input,

ItemmonthClassificationValueCategoryName
ChairJan-22Furniture50000Home FurnitureProfit
ChairJan-22Furniture50Home FurnitureSales

 

and Output

ItemmonthClassificationValueCategoryName
ChairJan-22Furniture50000Home FurnitureProfit
ChairJan-22Furniture50Home FurnitureSales
ChairJan-22Furniture1000 = 50000/50Home FurnitureRevenue
kiotsuresh
8 - Asteroid

Hi Shanker,

Can you please attach the workflow

 

thanks

Sureshkumar

ShankerV
17 - Castor

@kiotsuresh 

 

Please find the below input and output, where the 3rd row is completely derived.

 

ShankerV_0-1669018372227.png

 

Output:

 

ShankerV_1-1669018395412.png

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

@kiotsuresh 

 

Due to system limitations, I could not attached the workflow. Sorry for the inconvenience.

 

ShankerV_0-1669018532492.png

 

 

Can you please mirror my workflow, I have explained in 8 steps in detail.

 

Many thanks

Shanker V

kiotsuresh
8 - Asteroid

@ShankerV 

 

I'm getting an error while using the mod Function. 

kiotsuresh_0-1669019188559.png

 

Formula used : if ((mod[RecordID],2)=1)) then [value]/[Row+1:value]
else 0
endif

 

ShankerV
17 - Castor

Hi @kiotsuresh 

 

0 is 'Zero'

i.e in the statement else 0

 

Many thanks

Shanker V

ShankerV
17 - Castor

@kiotsuresh 

 

If you have your workflow, please do attached along with the input.

 

I can troubleshoot and make it run.

Its becoz of the incoming dataset here you would have created RecordID as String instead of Integer.

 

ShankerV_0-1669022880570.png

 

 

Many thanks

Shanker V

kiotsuresh
8 - Asteroid

Solution Achieved through different steps. Used Transpose and Crosstab functions and achieved.

Labels