community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

random sampling from data

Highlighted
Asteroid

Hi,

 

I am looking for random sampling from data based on the the conditions like the sampling of 10 records which should be from all the months available and the value should be high for at least 6 random samples..

 

Unique IDDateValue
1Aug 22, 2018-446394947
2Aug 30, 201847865
3Sep 12, 2018-350001947
4Sep 12, 20183214
5Sep 17, 2018-320001947
6Sep 21, 2018124
7Sep 27, 2018-159001947
8Oct 4, 2018-132281947
9Oct 5, 2018142124
10Oct 15, 2018412412
11Oct 15, 2018-129963813.7
12Oct 16, 2018-129963813.7
13Oct 19, 2018-129963813.7
14Oct 23, 201842141
15Oct 23, 2018-116125947
16Oct 29, 2018-82753947
17Nov 12, 2018-80810360.62
18Oct 19, 2018412412323
19Oct 22, 20184124
20Nov 12, 2018-78001947
21Aug 30, 201812412
22Sep 27, 201841242
23Oct 1, 2018-71815947
24Oct 23, 2018-70748302.88
25Nov 1, 2018-70748302.88
26Sep 28, 2018-67001947
27Oct 22, 2018-65147947
28Sep 12, 2018-64360947
29Sep 28, 2018-63418947
30Oct 22, 2018-62783947

 

 

output

 

Unique IDDateValue
25Nov 1, 2018-70748302.88
20Nov 12, 2018-78001947
14Oct 23, 201842141
19Oct 22, 20184124
18Oct 19, 2018412412323
15Oct 23, 2018-116125947
4Sep 12, 20183214
22Sep 27, 201841242
2Aug 30, 201847865
21Aug 30, 201812412

 

 

Thanks

Asteroid

Hi, tried to attempt this but I think you may need to either choose random sampling, or build logic to cut your data down.

 

The two aren't compatible.

 

If you use the sample and group by column function this will do the randomised element, but you can't then make sure it picks 6 high values above zero.

 

Labels