Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How can use Interface macro variable define the parameter value 'N' of Sample tool ?

ups366
8 - Asteroid

Dear all , hello !

 

1- As you know, used the Preparation tools like "Sample" or "Select Records" , we can manual input the value 50 or -100 for define the parameter 'N', but if want use Interface tools macro give variable to control the parameter 'N' before sample tool, How can i do that ? 

2- If someone give a *.yxmc case for demo, thank you very much !Nvar02.png

 

 

 

 

6 REPLIES 6
KaneG
Alteryx Alumni (Retired)

Hi @ups366,

 

Try a Number Picker going into the action tool. The Number Picker is the actual interface tool that the user will use.

 

Number_Picker_Sample.png

ups366
8 - Asteroid

@KaneG ,Hi.

 

There is no change, anything still as before. 

KaneG
Alteryx Alumni (Retired)

Attached is your example as a macro inside a workflow. The interface tools need to be either in an app or in a Macro.

ups366
8 - Asteroid

@KaneG  , Thanks a lot !

 

1- In my poor idea, I want to use some tools get the max value of continus null rows counts in all columns head. then assign the counts value to parameter 'N' of Sample tool, so the workflow are semi-auto mode .

2- As above instruction, If havn't macro tools, any other way or path to achieved the goals ?

3- If used some tools like formula tool retrun the value, how can transfer the value for Sample tool's parameter 'N' directly?

KaneG
Alteryx Alumni (Retired)

I see what you want to do... Using the sample tool manually configured is the easy way, but if you want to make it dynamic then the secret is to tag the rows.

 

Use a Multi-Row Formula tool to tag the rows with what they represent

 

Create a new field called DataFlag with the following:

 

IF IsNull([Field1]) OR [Row-1:Field1]=='State'
THEN [Row-1:DataFlag]+1
ELSE [Row-1:DataFlag]
ENDIF

 

You can then filter out the data into it's separate components... Note that in your sample data I moved the header row to the first row of the data. I find that it is always best to select the option on the Input Data that allows the first row of the file to be data (You then get entirely consistent headers)

Combine_Headers.png

ups366
8 - Asteroid

@KaneG ,

 

Yes ! This is my want ! Thank you very much !  

Labels