Alteryx Designer Desktop Discussions

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

Sample Tool

cpet13
10 - Fireball

We have a workflow that is using a sample tool, which is setup like the screenshot below. We are trying to get 3% of records for the column we've grouped by. However, the issue is that some 3% of some claim_ids is about .03 - because of this, no records are returned. We have a solution in place that in essence find those claim IDs and takes 1 record for each claim_id, but it is quite a bit of a workaround. It would be far simpler if we could just tell the sample tool to round up, or to take at least 1 record per claim_id. Is there any way to do something like that?

Screenshot 2024-06-14 145712.png

2 REPLIES 2
phottovy
13 - Pulsar
13 - Pulsar

Hey @cpet13,

 

Thanks for teaching me something new! I had no idea the Sample tool would drop rows in when they are under the %. Below is the simplest solution I can think of. If you calculate the number of rows per CLAIM_ID, then you can easily identify which rows will be dropped in your sample tool. I used a filter to keep 3% of the rows that are above the threshold and keep 1 row for any Claim_ID below the threshold and union them together:

 

Sample Tool Example.png

 

Like most problems, there are many ways to solve this one but this was the easiest way I could think of!

Qiu
21 - Polaris
21 - Polaris

@cpet13 
It does make more sense to me that there should be an option that we could just tell the sample tool to round up, or to take at least 1 record.
Maybe you can raise this idea at the Mission Control?

At the meam time, I found the similar work around with @phottovy 

https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Top-5-using-Sample-tool/td-p/5...

Labels