Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Macro user case?

xariet
8 - Asteroid

 

Hi!

I am really confused with how to approach this task, and I guess Macro will be an answer, but I can't figure out how to use it. I have the below information. I need to calculate total and property value, related to account 702684. Total and property value should be related to account 702684 through common properties

Property related to account 702684: 6,4,3,5. Logic explanation: we bring properties related to account 702684 , which are 6 and 4. Then we look which other accounts have either of those properties. Account 7012342 has property 4, but it also has property 3. As we already have property 4, we just add property 3 to our list. Now we look for accounts who have properties 6,4 or 3. Account 5207175 and account 56789-01 have property 3, also account 56789-03 has property 4. Account 56789-03 also has property 5, which we bring on our list. Now we need to sum up all property values which relate to account 702684 = 6+4+3+5=1326000+1800000+700000+210000.

And we need to sum up Totals for the same accounts: 70+550+500+230+100

I would really appreciate some directions for the workflow process to resolve this task.

PS. I can't to this task manually ( using filters, summarizing, ect) as this is just an example from the huge dataset, where those totals should be calculated automatically per each account in that dataset.

 

Asset customerCustomeraccountpropertyproperty valueTotal
1324A69309111690000300
1324A6992292310000200
1324A6992291690000200
1324A52071753700000500
1324A70123423700000550
1324A701234241800000550
1324A7026846132600070
1324A7026844180000070
1324B56789-013700000230
56789B56789-035210000100
1324B56789-0341800000100
2 REPLIES 2
Yoshiro_Fujimori
15 - Aurora

@xariet ,

 

Here is my solution.

I do not fully understand your calculation for accounts {6,4,3,5} below, as there are other values with the same account on the table.

1326000+1800000+700000+210000

70+550+500+230+100

But I believe the critical part is how to find all the related accounts. I hope this helps.

 

Macro

This iterative macro will stop when the number of records found is the same as the last iteration.

macro.png

 

Main workflow

The main workflow receives the related accounts from the macro and summarizes the original table.

main.png

Output

propertyMax_property valueMax_Total
41800000550
5210000100
6132600070
3700000550

 

Sum_Max_property valueSum_Max_Total
40360001270
OTrieger
12 - Quasar

@xariet 

You mentioned that your database is much bigger.
In the above description you started from one specific account, will this account always will be the first to start with, or this is only a generic explanation? This is important as based on your first selection you then check the relating to the other accounts.

As if this is only a generic description then you will need to concatenating the properties type based on the accounts so you will be able to see how the different accounts relating to the different properties, then you will be able to assign the value and total and sum the up. 

Labels