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 to get the desired output

AKPWZ
8 - Asteroid

I'm trying "If StartsWith(JSON_Name,'data.rows.0') Then [Row-1:Counter]+1 Else[Row-1:Counter] EndIf"  into Mmulti-Row formula tool to get the desired output (attached screenshot), but not sure what I'm doing wrong and getting something else.

 

I want to use a counter whenever there is a change - like;  'data.rows.0' to 'data.rows.1' and likewise

Please review my logic and help me to get the right solutions. Thanks

 

AKPWZ_1-1676288815883.png

 

12 REPLIES 12
ShankerV
17 - Castor

Hi @AKPWZ 

 

One way of doing this easily is.

 

ShankerV_0-1676289111016.png

 

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @AKPWZ 

 

Using multi row formula.

 

IF Right([Field1],1)="0"
THEN [Row-1:Output]+1
ELSE [Row-1:Output]
ENDIF

 

ShankerV_0-1676289587675.png

 

Many thanks

Shanker V

 

RobertOdera
13 - Pulsar

Hi, @AKPWZ 

 

Your sample data suggests a pattern that requires solving for an increase of records from 1, 10, 100, 1000,...Nth.

But maybe your data will never go/grow to that extent (anyways, I still took care of that possibility).

 

Please see the below.

Please mark it as an acceptable solution if it works for you. Cheers!

 

RobertOdera_0-1676298850024.png

 

RobertOdera
13 - Pulsar

Hi, @AKPWZ 

 

This solution anticipates the future.

Please see the below.

Please mark it as an acceptable solution if it works for you.

 

RobertOdera_0-1676300860222.png

 

AKPWZ
8 - Asteroid

Thank you @RobertOdera this is exactly what I was looking for.

AKPWZ
8 - Asteroid

Thank you @ShankerV for your response. Your given logic is not working for me, as it touch 10,11,12 and so on; its giving only the first integer value as an output  like, for 10 - 1, 11 - 1, 12 - 1 , its not giving me as 10, 11, 12, ...

ShankerV
17 - Castor

Hi @AKPWZ 

 

Thanks, I just tweaked the below to get your result done.

 

From (\d) to (\d+)

 

ShankerV_0-1676361296360.png

 

 

Many thanks

Shanker V

AKPWZ
8 - Asteroid

Hi @ShankerV@RobertOdera attached that sample as a screenshot, please have a look at it.

ShankerV
17 - Castor

Hi @AKPWZ 

 

Have posted the modified workflow in the last post, please check whether it helps!!!!

 

I have checked with many inputs, works fine. Can you check and confirm from your end!!! Fine, if it works as expected.

 

ShankerV_0-1676361549148.png

 

ShankerV_0-1676361672063.png

 

Cheers!!!!

Shanker V

Labels