Alteryx Designer Desktop Discussions

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

Multi Row Formula

cfine
7 - Meteor

I am trying to use a multi-row formula tool here to give me a difference column which will take sum of values for those line items which have the same description and Name.  I am having a hard time coming up with the correct formula.  I appreciate any help you can offer.

 

RecordIDDescriptionNameValueDifference
2ABCCost-1000 
3ABCCost1250250
2ABCInt-1550 
3ABCInt870-680

 

I have tried the following formula and it only gives me the value and not adding the 2 lines together.

ToNumber(If [Derivative]=[Row+1:Derivative]
AND [Name]=[Row+1:Name]
THEN ([Value]+[Row+1:Value])
ELSE NULL() ENDIF)

 

Thank you!

8 REPLIES 8
OllieClarke
15 - Aurora
15 - Aurora

Hi @cfine I think a summarise tool is a better way to go than a multi-row formula

OllieClarke_0-1573229058990.png

LordNeilLord
15 - Aurora

Hey @cfine 

 

You can make use of the grouping functions in the multirow here...group by Description and Name then you can just use the formula value+row-1:value 

 

Capture.PNG

CharlieS
17 - Castor
17 - Castor

Try this formula:

IF [Description]=[Row-1:Description] AND [Name]=[Row-1:Name] THEN [Value]+[Row-1:Value]
ELSE null() ENDIF

 

20191108-MultiRowFormula.png

OllieClarke
15 - Aurora
15 - Aurora

@cfine If you only want this value on the final row, then take the max recordID as well and use that in the join too. This approach works if you have multiple or varying rows per name/description, whereas a multi-row formula would be less dynamic

OllieClarke_0-1573229254174.png

LordNeilLord
15 - Aurora

@OllieClarke  = multi-row hater

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @cfine,

 

Is this what you're looking to achieve? I've simply summarised by description and name and taken sum of values.

 

image.png

 

If this solves your question please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

Jonathan-Sherman
15 - Aurora
15 - Aurora

@LordNeilLord  @OllieClarke looks like i was a little late on this one!

OllieClarke
15 - Aurora
15 - Aurora

@LordNeilLord I love a multi-row, I'm just saying what happens if your data's like this:

RecordIdNameDescriptionValue
1ABCCost-1000
2ABCCost1250
1ABCInt-1550
2ABCInt870
3ABCInt2500

 

Labels