Free Trial

Alteryx Designer Desktop Discussions

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

Same Formulas for Multiple Repeating Columns

aiste_griffiths
7 - Meteor

I have a raw data set that has 277 columns (5 columns per Month).

If you look at the raw excel data, it's actually split in the middle (row 44: Removed Devices). Rows above that are Active Devices and rows below that are Removed Devices.

 

For each month in this dataset (Jan 2020 to July 2024)  I need to calculate:

1. Total cost ex gst

2. Total Cost: Rental

3. Total Cost: Transaction

 

 

Total cost ex gst is a sum of column "total cost ex gst" (both active and removed devices)

Total Cost: Rental is a sum of column "rental" (both active and removed devices)

Total Cost :Transaction is a sum of columns Withdrawals + Deposits + Balance Enq (both active and removed devices)

 

I have been trying to apply Transpose, Cross Tab and Multi Row formula tools for hours now with no luck 😫!! Could you please guide me how to manipulate this particular data to get desired sums for each month and to display it on the same sheet? Thank you!

 

 

 

14 REPLIES 14
flying008
15 - Aurora

Hi, @aiste_griffiths 

 

You need upload sample data table as your want output!

录制_2024_10_30_11_35_34_651.gif

 

Input           
F1F22020-1-12020-01-01_22020-01-01_32020-01-01_42020-01-01_52020-2-12020-02-01_22020-02-01_32020-02-01_42020-02-01_5
DeviceLocationWithdrawalsDepositsBalance EnqRentalTotal cost ex gstWithdrawalsDepositsBalance EnqRentalTotal cost ex gst
10Odense585.5227.369.217452367.08742.0431.929.6817452528.64
11Aalborg [c]         
12Esbjerg159.1225.465.4417451935.02379.630.028.8817452163.5
13Randers28.67.62.4816701708.68392.281.7616701713.04
14Horsens348.9219.765.7617452119.44383.2417.13.3617452148.7
15Kolding725.442.9417.217452530.54457.639.915.6817452258.18
16Vejle          
17Roskilde915.277.1431.6817452769.02715.5273.7228.1617452562.4
18Herning484.1268.0227.8417452324.98414.4476.7623.0417452259.24
19Silkeborg          
20Hørsholm359.8466.517.4417452188.7895.6820.148.6417451869.46
21Helsingør103.4816.7210.7217451875.92354.1259.2817.6817452176.08
22Næstved333.8490.0615.1217452184.02330.7299.9414.5617452190.22

 

Output                 
F1_DeviceF2_Location2020-01-01_Withdrawals2020-01-01_Deposits2020-01-01_Balance Enq2020-01-01_Rental2020-01-01_Total cost ex gst2020-01-01_Total cost_Ex Gst2020-01-01_Total Cost_Rental2020-01-01_Total Cost_Transaction2020-02-01_Withdrawals2020-02-01_Deposits2020-02-01_Balance Enq2020-02-01_Rental2020-02-01_Total cost ex gst2020-02-01_Total cost_Ex Gst2020-02-01_Total Cost_Rental2020-02-01_Total Cost_Transaction
10Odense585.5227.369.217452367.082367.081745585.5227742.0431.929.6817452528.642528.641745742.0431
11Aalborg [c]                
12Esbjerg159.1225.465.4417451935.021935.021745159.1225379.630.028.8817452163.52163.51745379.63
13Randers28.67.62.4816701708.681708.68167028.67392.281.7616701713.041713.041670392.281
14Horsens348.9219.765.7617452119.442119.441745348.9219383.2417.13.3617452148.72148.71745383.2417
15Kolding725.442.9417.217452530.542530.541745725.442457.639.915.6817452258.182258.181745457.639
16Vejle                
17Roskilde915.277.1431.6817452769.022769.021745915.277715.5273.7228.1617452562.42562.41745715.5273
18Herning484.1268.0227.8417452324.982324.981745484.1268414.4476.7623.0417452259.242259.241745414.4476
19Silkeborg                
20Hørsholm359.8466.517.4417452188.782188.781745359.846695.6820.148.6417451869.461869.46174595.682
21Helsingør103.4816.7210.7217451875.921875.921745103.4816354.1259.2817.6817452176.082176.081745354.1259
22Næstved333.8490.0615.1217452184.022184.021745333.849330.7299.9414.5617452190.222190.221745330.7299

 

 

Sum Output     
Sum_2020-01-01_Total cost_Ex GstSum_2020-01-01_Total Cost_RentalSum_2020-01-01_Total Cost_TransactionSum_2020-02-01_Total cost_Ex GstSum_2020-02-01_Total Cost_RentalSum_2020-02-01_Total Cost_Transaction
22003.48173754044.260121869.46173754265.3475

 

 

Running Total Output                      
F1_DeviceF2_Location2020-01-01_Withdrawals2020-01-01_Deposits2020-01-01_Balance Enq2020-01-01_Rental2020-01-01_Total cost ex gst2020-01-01_Total cost_Ex Gst2020-01-01_Total Cost_Rental2020-01-01_Total Cost_Transaction2020-02-01_Withdrawals2020-02-01_Deposits2020-02-01_Balance Enq2020-02-01_Rental2020-02-01_Total cost ex gst2020-02-01_Total cost_Ex Gst2020-02-01_Total Cost_Rental2020-02-01_Total Cost_TransactionRunTot_2020-01-01_Total cost_Ex GstRunTot_2020-01-01_Total Cost_RentalRunTot_2020-01-01_Total Cost_TransactionRunTot_2020-02-01_Total cost_Ex GstRunTot_2020-02-01_Total Cost_RentalRunTot_2020-02-01_Total Cost_Transaction
10Odense585.5227.369.217452367.082367.081745585.5227742.0431.929.6817452528.642528.641745742.04312367.081745585.52272528.641745742.0431
11Aalborg [c]                2367.081745585.52272528.641745742.0431
12Esbjerg159.1225.465.4417451935.021935.021745159.1225379.630.028.8817452163.52163.51745379.634302.13490744.64524692.1434901121.6731
13Randers28.67.62.4816701708.681708.68167028.67392.281.7616701713.041713.041670392.2816010.785160773.31526405.1851601513.9541
14Horsens348.9219.765.7617452119.442119.441745348.9219383.2417.13.3617452148.72148.71745383.24178130.2269051122.23718553.8869051897.1958
15Kolding725.442.9417.217452530.542530.541745725.442457.639.915.6817452258.182258.181745457.63910660.7686501847.679110812.0686502354.8348
16Vejle                10660.7686501847.679110812.0686502354.8348
17Roskilde915.277.1431.6817452769.022769.021745915.277715.5273.7228.1617452562.42562.41745715.527313429.78103952762.956113374.46103953070.3621
18Herning484.1268.0227.8417452324.982324.981745484.1268414.4476.7623.0417452259.242259.241745414.447615754.76121403247.082915633.7121403484.8097
19Silkeborg                15754.76121403247.082915633.7121403484.8097
20Hørsholm359.8466.517.4417452188.782188.781745359.846695.6820.148.6417451869.461869.46174595.68217943.54138853606.929517503.16138853580.4917
21Helsingør103.4816.7210.7217451875.921875.921745103.4816354.1259.2817.6817452176.082176.081745354.125919819.46156303710.411119679.24156303934.6176
22Næstved333.8490.0615.1217452184.022184.021745333.849330.7299.9414.5617452190.222190.221745330.729922003.48173754044.260121869.46173754265.3475

 

Qiu
21 - Polaris
21 - Polaris

@aiste_griffiths 
This seems to be a real business case.

I am take a bit different way as below, working with the header and the use Regex to seperate Accounting category and Month.

I cross check with Excel manual sum an it seems to be correct.

1030-aiste_griffiths.png1030-aiste_griffiths-A.png

aiste_griffiths
7 - Meteor

Hi, @flying008 

 

Thanks a million for a quick reply! Wow that looks advanced??!

To be honest with you, sum output on it's own ( as per below) would work as long as it sums up each month (i'm not required to sum up by location).

 

     
Sum_2020-01-01_Total cost_Ex GstSum_2020-01-01_Total Cost_RentalSum_2020-01-01_Total Cost_TransactionSum_2020-02-01_Total cost_Ex GstSum_2020-02-01_Total Cost_RentalSum_2020-02-01_Total Cost_Transaction
22003.48173754044.260121869.46173754265.3475
 

I did a little manual testing, looks like Columns : Total cost_Ex Gst and Total Cost_Rental sum up to the correct figure, however Total_Cost_Transaction does not. 

 

If we work with data - Devices 10-22- : Sum_2020-01-01_Total Cost_Transaction should be 4628.48, Sum_2020-02-01_Total Cost_Transaction should be 4494.46.

 

 

 

 

Qiu
21 - Polaris
21 - Polaris

@aiste_griffiths 
If I simply sum up the F column in your Excel I can get the 146680 shown in above snapshot.
How did you come up with the 17375?

Qiu
21 - Polaris
21 - Polaris

@aiste_griffiths 
I forgot that Transaction is a sum of columns Withdrawals + Deposits + Balance Enq (both active and removed devices)

This is the revised on.

1030-aiste_griffiths-r1.png

flying008
15 - Aurora

Hi, @aiste_griffiths 

 

Yes, you are right. this is my mistake with loss some symbol in formula.

 

Sum_2020-01-01_Total cost_Ex GstSum_2020-01-01_Total Cost_RentalSum_2020-01-01_Total Cost_TransactionSum_2020-02-01_Total cost_Ex GstSum_2020-02-01_Total Cost_RentalSum_2020-02-01_Total Cost_Transaction
22003.48173754628.4821869.46173754494.46
aiste_griffiths
7 - Meteor

Hi @Qiu 

 

Thank you so much for your input! I'll review updated workflow tonight and if all good will Accept As Solution!

 

p.s. might look like a real business case, but it's fake data.

aiste_griffiths
7 - Meteor

Hi @flying008 

 

thank you so much for your assistance with above case, would you mind sharing the workflow? I will then review it all in the evening and if all good will accept as solution :) Thank you!!!!

flying008
15 - Aurora

Hi, @aiste_griffiths 

 

Due to security policy restrictions, I am unable to upload .yxmd file, so please create your own based on the workflow tool animation.

BTW, @Qiu 's workflow seems much simpler than my process, so please accept his work as solution. wish you both have a good day!

Labels
Top Solution Authors