Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Macro updating multi-row-formula with Numeric Up down

sebastian123Han
7 - Meteor

Hey! I have a question regarding getting my multi-row formula to update in alteryx.

I have attached the macro I'm currently working on! As you can see in the end of the macro I'm trying to update the number of words chosen for the multi-row formula:

sebastian123Han_0-1634021862031.png

Where from the formula: if !isnull([Count]) then REGEX_Replace([Row-1:NewKPI], '(\w+)(\s|-).+', '$1') + " " + GetWord([Row-1:NewKPI], 2) + ' ' +[Field_To_Rename] else [Field_To_Rename] endif

It replaces the 2 in the GetWord.

 

This is working such that if I choose 1 it says "Revenue For Fisk". However, if I Choose 0 it returns "Revenue Revenue Fisk" or if I choose 2 it returns "Revenue Me Fisk".

Is there a way to make it update such that if I choose 0 it returns "Revenue Fisk", if I choose 1 it returns "Revenue For Fisk" or if I choose 2 it returns "Revenue For Me Fisk"?

 

Any help is appreciated! 

 

5 REPLIES 5
PhilipMannering
16 - Nebula
16 - Nebula

Hi @sebastian123Han 

 

You could try this... though there are probably more elegant ways.

 

atcodedog05
22 - Nova
22 - Nova

Hi @sebastian123Han 

 

Just seeking more clarification let's say the number selected is 2 would the output be something like below or something else?

 

Field_To_Rename RecordID Count NewKPI
Revenue For Me 1   Revenue For Me
FISK 2 2 Revenue For Me FISK
LASK 3 2 Revenue For Me LASK
TUN 4 2 Revenue For Me TUN
Cost For Me 5   Cost For Me
FISK 6 2 Cost For Me FISK
LASK 7 2 Cost For Me LASK
TUN 8 2 Cost For Me TUN
sebastian123Han
7 - Meteor

Hey!

Yeah I can see it is not really clear. This was the scenarios I was imagining 🙂

sebastian123Han_0-1634034294101.png

 

Christina_H
14 - Magnetar

Here's an updated version that I think should do what you need

atcodedog05
22 - Nova
22 - Nova

Hi @sebastian123Han 

 

Here is my take. You can convert the app to macro by changing input and browse to macro input and macro output.

 

Workflow:

atcodedog05_0-1634037094262.png

 

Hope this helps : )

Labels