Alteryx Designer Knowledge Base

Definitive answers from Designer experts.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here

Tool Mastery | Sample

Alteryx Community Team
Alteryx Community Team
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.

Attachments
Comments
Alteryx Partner

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 

8 - Asteroid

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

 

Alteryx Community Team
Alteryx Community Team

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

 

Best regards,

MattD

5 - Atom

Images referenced above are still out of order.

Alteryx Community Team
Alteryx Community Team

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

5 - Atom

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

Alteryx Community Team
Alteryx Community Team

Ah. Better now, @mikepawlik ?

Alteryx Partner

it's allright @NeilR 

5 - Atom

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. 

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

5 - Atom

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

Alteryx
Alteryx

@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

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/

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