Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

multi-row formula, Row - 1 , need to make that dynamic somehow

wonka1234
10 - Fireball

Hi

 

 

before multi row tool:

 

FileNameNameValue
Book (3)Amt2
 Amount 
 Process

 

 

 

after:

FileNameNameValue
Book (3)Amt2
File Name :  does not contain field : Amount 
File Name :  does not contain field : Process 

 

multi row formula:

 

if isnull([FileName]) then "File Name : " + [FileName] + " does not contain field : " else [FileName] endif

 

 

I know I could do this:

 

if isnull([FileName]) then "File Name : " + [Row-1:FileName] + " does not contain field : " else [FileName] endif

 

 

however it will not work. I need to be able to do -2 but in a dynamic fashion. As There could be many rows before row 1 here.. 

 

if I did -1 it will look like :

 

 

FileNameNameValue
Book (3)Amt2
File Name : Book (3) does not contain field : Amount 
File Name : File Name : Book (3) does not contain field :  does not contain field : Process 

 

 

any help would be appreciated.

4 REPLIES 4
ed_hayter
13 - Pulsar

I've added another conditon to your multi-row, assuming the names are in a consistent order,

if isnull([FileName]) AND [Name] = "Amount"
then "File Name : " + [Row-1:FileName] + " does not contain field : " elseif
isnull([FileName]) AND [Name] = "Process"
then "File Name : " + [Row-2:FileName] + " does not contain field : " else
[FileName] endif

 

I've attached the workbook as well.

 

If your Name column is not in a consistent order you can make a record ID for every 3 rows (https://www.thedataschool.co.uk/henry-mak/modulo-increment-number/) and then assign the names an order rank (amt = 1, Amount = 2, Process = 3) and sort by the recordID, then the measure rank to ensure the correct order

binuacs
21 - Polaris

@wonka1234 one way of doing this

Screenshot 2023-06-29 155730.png

wonka1234
10 - Fireball

@ed_hayter thanks but my "Name" column will never be the same.. I cant really hardcode this :( also I dont know how many differnet names there will be..

SPetrie
13 - Pulsar

Another possible method is using regex in the multi-row to test for and replace the name as appropriate.

Im sure my regex could be improved upon, but it shows how the method could work.

 

if isnull([FileName]) and contains([Row-1:FileName],":") then REGEX_Replace([Row-1:FileName],"
.+:(.+) does.+","File Name : $1 does not contain field :") elseif isnull([FileName]) and !contains([Row-1:FileName],":") then "File Name : "+[Row-1:FileName]+" does not contain field :" else [FileName] endif

 

multirow.PNG

Labels
Top Solution Authors