We are aware of missing items on the Community's main navigation and are working to resolve this issue. The pages are accessible using Community search or direct links. We apologize for the inconvenience and thank you for your patience as we work toward a solution.
Free Trial

Tool Mastery

Explore a diverse compilation of articles that take an in-depth look at Designer tools.
Become a Tool Master

Learn how you can share your expertise with the Community

LEARN MORE

Tool Mastery | Sample

MattD
Alteryx Alumni (Retired)
Created

Sample.pngThis article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here we’ll delve into uses of the Sample Tool on our way to mastering the Alteryx Designer:

 

The Sample Tool allows you selectively pass patterns, block excerpts, or samples of your records (or groups of records) in your dataset: the first N, last N, skipping the first N, 1 of every N, random 1 in N chance for each record to pass, and first N%. Using these options can come in the clutch pretty often in data preparation – that’s why you’ll find it in our Favorites Category, and for good reason. While a great tool to sample your data sets, you can also use it for:

 

  • Flexible parsing (attached in the workflow Sample.yxzp)

1.png

Input formats like the above are especially common with transactional data stores.

 

  • Stripping (often Excel) formatting from input tables (attached in the workflow Sample.yxzp)

2.png

 

See here for a more detailed walkthrough on how to input data that doesn't start in the first row.

 

  • Quick appending min/max or chronological first/last in date types (attached in the workflow Sample.yxzp)

Image.png

 

This can also be done with groups of records by using the “Grouping Fields” selection in the Sample Tool’s configuration. The technique itself is also possible, and with multiple fields at a time, using the Summarize Tool.

 

With use cases like the above, the Sample Tool is easily 1 of every N=1,000,000!

 

By now, you should have expert-level proficiency with the Sample Tool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know at community@alteryx.com if you’d like your creative tool uses to be featured in the Tool Mastery Series.

 

Stay tuned with our latest posts every Tool Tuesday by following Alteryx on Twitter! If you want to master all the Designer tools, consider subscribing for email notifications.
 

Additional Information

Click on the corresponding language link below to access this article in another language -

Portuguese
Spanish
French
German
Japanese

Attachments
Comments
anishbhola
7 - Meteor

Hi @MattD

I think the images in the last workflow are incorrectly represented.

First Image should have been in output browse and the second one in the input browse.

Kindly correct me if I am wrong.

Thanks 

RichoBsJ
11 - Bolide

Hi @, I think @anishbhola is right.

Pictures in the workflow 'Quick appending min/max or chronological first/last in date types' have been placed one in the place of the other and vice versa,

as the column 'Max Scale' was created from the maximum value extracted by the Sample tool.

Regards

 

MattD
Alteryx Alumni (Retired)

Thanks for pointing that out for us, @anishbhola and @RichoBsJ! The images should be fixed with our last revisions.

 

Best regards,

MattD

mikepawlik
5 - Atom

Images referenced above are still out of order.

NeilR
Alteryx Alumni (Retired)

@mikepawlik It looks correct to me. Can you be more specific?

mikepawlik
5 - Atom

I am referencing the images in the Sample.yxzb workflow. They have not been corrected.

NeilR
Alteryx Alumni (Retired)

Ah. Better now, @mikepawlik ?

jdemeaux
8 - Asteroid

it's allright @NeilR 

When you used one of the tools, is it possible to know with what statistical procedure it was extracted? No matter what tool is used.. Thank you. 

Janos_B
5 - Atom

 

Hi Everyone,

 

I've just attempted to use the sample tool for returning the last (1) row from an Excel (xlsx) file by selecting the "Last N rows" option and setting N = 1.

Still it does return all the rows in the file. Can anyone tell why it happens, and more importantly how - if at all - can this tool be used to return indeed just the last single row?

 

Alteryx - Sample tool - 2019-04-10_11-43-53.png

Dear Janos_B,

 

The tool must work extracting a single record N = 1, maybe you need to use Sort Tool before use Sample. This is the easy way to you obtain the sample.

 

Best, 

Valeria

KatieA
Alteryx Alumni (Retired)

@Janos_B 

 

I just tested your scenario and it worked. 

 

Input Data tool with XLSX file and Sample tool with Last N rows = 1.

 

I understand my response is late but please let me know if you are still experiencing this behavior.

 

Thanks,

Katie

salgamez
6 - Meteoroid

Week2-Day3-Sample-Tool-Mastery.PNGThe link highlighted when clicked seems to be broken. I found the sample exercise via search. I believe when clicked it should take the user to this page https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Sample/ta-p/36758

This is where the link takes you when clicked http://sample%20tool%20mastery/

Oshin_Sharma
5 - Atom

Hi @salgamez,

 

I have a quick inquiry about your post, if you don't mind me asking. I have started alteryx course recently and going through the program day by day. But I seem to have lost the page that your posted. I don't know where do I go for weekly or day-to-day curriculum. Can you please help me? 

Thank you 

mjsnyder
7 - Meteor

When using the sample tool, it randomly selects the data.

SRR
5 - Atom

In @Flexible Parsing (Image 1 workflow), How is the output of sample 1 of every N=3 not having any null rows or row containing rep,sale,date header values in the first work flow? How does the tool sample only valid and relevant numerical data ?

yatish1164
7 - Meteor

Liked the one in a million reference 😄 !! Good article.

Shyam_amarapu_2002
7 - Meteor

5-atom

Mgaurav2grt
7 - Meteor

its amazing