Alteryx Designer Desktop Discussions

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

Using Multi Row Formula to return larger between active and row +1

dmuseve
6 - Meteoroid

Hi All,

 

I am not sure if this has been answered else where but I have not been able to locate it through my searches on the community page. I have data that is presented in a waterfall effect. The total of all data is at the top of the house and then each subsequent row will contain the building blocks of that total. I am trying to use the multi row formula to compare 2 rows ( active and row +1) to determine which of the 2 rows has a larger number. I think my logic is faulty as it is not returning the correct results. I have provided an example of the excel file data which shows the waterfall and the formua results for the same if logic, and  also the logic for the multi row formula. Thanks for your help

Excel file example.pngif logic.pngbf

 

4 REPLIES 4
BenMoss
ACE Emeritus
ACE Emeritus

Can you share some sample data.

 

I imagine the trailing spaces may cause a problem here. I recommend creating a copy of your account field and then using a data cleanse to strip out the leading space.

 

Then perform this calc. Without the data it's hard to see why your calculation may not work.

 

Ben

tcroberts
12 - Quasar

I've slightly modified your formula to instead look at the length of the digit, instead of its actual value.

 

Let me know if this wouldn't work for some other reason not present in this sample data, but otherwise it seems to produce your desired result.

 

waterfall.PNG

 

EDIT: But I do agree with the above poster, you'll need to remove trailing and leading whitespace for this to work. You could create a new field which does this using the Formula tool with NewField = [ACCOUNT], and then just strip the white space from NewField, do the computation on that, and drop it afterwards so you still have the waterfall-like effect in your workbook.

dmuseve
6 - Meteoroid

Thank you! Adjusting for the length worked. I had done a cleanse but I don't think it worked so I took your suggestion and created a formula copying the data from the account field, which also helped. 

tcroberts
12 - Quasar

No problem!

 

If my answer (or BenMoss') helped, please accept one (or both!) as the solution so that others with similar questions can find an answer. (:

 

Labels