Free Trial

Alteryx Designer Desktop Discussions

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

Calculating ROWs in alteryx

SahadhKuruniyan
8 - Asteroid

For one of my project I need to calculate subtotal in ROW. I have spent 3 weeks figuring out a way in alteryx but nothing did not work. Please see below table. I need to calculate rows where there is X.

 

Account20222021
Interest Expense43531315
Interest Income44323232
Net Interestxxxx
Commissions2324342
Other income323322
Other expense32325344
Net incomexxxx

 

I am thinking to have this table in a Horizontal format and do a normal formula tool calculation. Is it possible to convert the table within the alteryx

 

AccountInterest ExpenseInterest IncomeNet InterestCommissionsOther incomeOther expenseNet income
202243534432xx2323233232xx
202113153232xx43423225344xx
6 REPLIES 6
jdminton
12 - Quasar

I've included your request in the attached workflow, but the container identified as Preferred will allow you to set up your structure and prevent you from manually needing to create formulas. You will likely need to update the Template input to fit your output desired, but it will save you tons of time in the long run.

nagakavyasri
12 - Quasar

Screenshot 2023-06-14 142332.png

Vidhatri
5 - Atom

Thank you for your input, it was really helpful. I tried replicating this on my workflow and used 'Formula' tool to get the row totals (i.e., Net Interest = Interest Revenue + Interest Expense)

However, I would like to know how can we get the data back into the original format after calculating the row totals i.e., horizontally? 

I would like to see the output in the below format after the row totals (i.e., Net Interest) are calculated:

 

Account

Dec22_ytd

Dec22_qtd

Mar23_ytd

Mar22_ytd

Interest Expense

-10

-20

-30

-40

Interest Revenue

30

50

40

60

Net Interest

20

30

10

20

 

I have also attached the workflow screenshot as well. 

flying008
15 - Aurora

Hi, @Vidhatri 

 

无标题.png

Qiu
21 - Polaris
21 - Polaris
jdminton
12 - Quasar

@Vidhatri I updated the workflow to do this. It is really just another transpose and crosstab after the formula. I've highlighted the new portion in the green container.

 

The reason I included the RecordID as part of the account was to be able to sort the line items in the required order. Once you flip them back, the sorting can become different. That record ID will allow you to sort in the desired order. You could also use the structure and join method I have in the second workflow.

Labels
Top Solution Authors