Alteryx Designer Desktop Discussions

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

How to use Multi-Row Formula but instead of IsNull, the test is if row has leading spaces?

maddada
5 - Atom

Hi everyone!

 

I just wanted to know if I can use the Multi-row function if I am not testing if the row is null, but instead if the row has leading whitespaces.

My data has sub-headers for each region, and I want to add the sub-header on the regions to differentiate them per sub-header.

 

I want them to become Revenue Asia, Revenue Canada, Revenue U.S. and Net Income Asia, Net Income Canada, Net Income U.S.

As you can see on the screenshot, my condition is not that they are null, but they have leading whitespaces.

 

Let me know if another function is better to use in this situation than the multi-row function. Screenshots of used formulas and functions to solve this are very much appreciated. Thank you!

maddada_0-1680075194693.png

 

3 REPLIES 3
BS_THE_ANALYST
14 - Magnetar

@maddada I would approach it like this, assuming they may not always have trailing spaces, and when they do, what if they have multiple etc. This will cater for that. 

Step 1: setup problem

BS_THE_ANALYST_0-1680076495434.png

Step 2: extract headers (this is where you can pull out the headers based on logic)

BS_THE_ANALYST_1-1680076749265.png

 

Step 3:
Concatenate headers and subheaders:

BS_THE_ANALYST_2-1680076764868.png

Step 4: Filter:

BS_THE_ANALYST_3-1680076787812.png

 

 

 

 

maddada
5 - Atom

Woooaaah! I didn't think of doing it that way. Thank you so much for this! 🤓

BS_THE_ANALYST
14 - Magnetar

@maddada that's the beautiful thing with Alteryx, there's so many ways to do things 😎

All the best,
BS

Labels