We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Multi Row Formula Issue

akhandsingh305
5 - Atom

Hi All, 

 

I have got one issue with my report where we have to identify two matching conditions and mark a result if they match.

So here we have 3 columns, ID, Cost and Cost EUR. So if the ID's match and the sum of their respective Cost makes 0 then we want 'Remove' as in Result column, else 'Remain'.

Any help would be highly appreciated.

 

Thanks 

 

6 REPLIES 6
PanPP
Alteryx Alumni (Retired)

Hi @akhandsingh305,

 

1) The first tool would be a Summarize tool, grouping by the ID column and sum of the cost column.

2) Use a join tool to merge back on ID (Join by specific fields)

3) Use a formula tool with the conditional logic: If [Sum_Cost] = 0 then "Remove" else "Remain" endif

 

 

Hope this helps, if it does please like this post and if it helps resolve your problem, mark it as a solution. If you have any other questions, please let us know.

ShankerV
17 - Castor

Hi @akhandsingh305 

 

One way of solving this with only multi row formula is as below:

 

Input:

ShankerV_1-1670313681334.png

 

Workflow:

ShankerV_2-1670313697328.png

 

Result:

ShankerV_0-1670313663855.png

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

Hi @akhandsingh305 

 

As it was not able to achieve with singe multi row formula, used 2 as per below combination to reach the output.

 

1st Multi row:

ShankerV_0-1670313840945.png

 

2nd multi row:

 

ShankerV_1-1670313867947.png

 

 

Many thanks

Shanker V

ShankerV
17 - Castor

@akhandsingh305 

 

1st multi row formula:

if ([ID]!=[Row-1:ID])
then 1
elseif ([Cost]+[Row-1:Cost]=0)
then "Remove"
else "Remain"
endif

 

2nd multi row formula:

if [New Field]="1"
then [Row+1:New Field]
else [New Field]
endif

 

Many thanks

Shanker V

 

binuacs
21 - Polaris

@akhandsingh305 One way of doing this with the summarise tool

 

binuacs_0-1670320933373.png

binuacs_1-1670321309135.png

 

akhandsingh305
5 - Atom

Thank you @panpp @shankerV and @binaucs for your quick help here. 

Labels
Top Solution Authors