-
1. Re: Does anyone know about Extract sample option ?
Dmitry ChirkovMay 29, 2016 7:02 PM (in response to Cüneyt ASLAN)
1 of 1 people found this helpfulSome databases have sampling capabilities and Tableau is able to use those. It's like TOP but more random.
Here's Oracle documentation:
The
sample_clause
lets you instruct the database to select from a random sample of data from the table, rather than from the entire table. -
2. Re: Does anyone know about Extract sample option ?
Tomas Kafka Jan 6, 2017 7:35 AM (in response to Dmitry Chirkov)Hello Dmitry, how does sampling work on MySQL database? I'd like to use it, but only if it can get representative sample (I have data where top N rows definitely isn't a random sample). Thanks!
-
3. Re: Does anyone know about Extract sample option ?
Dmitry ChirkovJan 6, 2017 10:12 AM (in response to Tomas Kafka)
2 of 2 people found this helpfulFor MySQL we are running this query:
SELECT * FROM (<your relation>) as AS `TableauSampleRecords` ORDER BY RAND()
It does give a pretty good representative sample however it's known for not being very efficient with large row count.
You can read about it here:
MySQL: ORDER BY RAND() – a case study of alternatives | Robert Hartung http://www.roberthartung.de/mysql-order-by-rand-a-case-study-of-alternatives/
MySQL :: MySQL 5.7 Reference Manual :: 9.2.1.15 ORDER BY Optimization
-
4. Re: Does anyone know about Extract sample option ?
Tomas Kafka Jan 9, 2017 2:40 AM (in response to Dmitry Chirkov)Thanks! I don't care much for efficiency, happy to know that it is representative sample .