Alteryx Designer Desktop Discussions

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

Macro/Batch Macro

Florin
6 - Meteoroid

Hi everyone,

 

I have 2 tables [Raw] and [Totals]. Both contain same field structure, ID and Account , but in [Raw] table, field Account is not populated. And I want to do this based on values from [Totals] table.

 

Based on ID field values comparison of 2 tables , I want to populate Account field in [Raw] using that sequence :

 

IF ID[raw]<ID[Totals]

Then

Account[Totals]=Account[Raw]

 

Very important is that comparison should be done always for remaining items in both tables at each loop run.

 

I am new in Alteryx and any idea will help me to fix this issue.

 

Many thanks

 

Best regards

 

Florin

 

 

 

 

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @Florin 

 

Can you provide us the files used in the workflow. You need to provide us the input file for us to be able to run the workflow and see the inputs and outputs.

Florin
6 - Meteoroid

Ok. Sure. Apologize for late reply.

atcodedog05
22 - Nova
22 - Nova

Hi @Florin 

 

Based on your expected output and logic here another way of doing it. Check for your scenario and see whether it works.

 

Workflow:

atcodedog05_0-1628161779841.png

 

1. Union raw and total.

2. Sort them descending by ID. The reason is lower ID will need to take amt from higher ID.  ID[raw]<ID[Totals]

3. Using multi-row formula tool to fill out lesser ID's which are null with higher ID amt. This cover 2 logics

  1. Exhausting the list on each total ID
  2. Applying logic 

    IF ID[raw]<ID[Totals]

    Then

    Account[Totals]=Account[Raw]

4. Sorting Id on ascedning.

 

Hope this helps : )

Florin
6 - Meteoroid

Many thanks @atcodedog05 . That's fantastic !😊 Lots of thanks.

Labels