VIsualizations with Sample data


#1

Hey guys i have an interesting situation, i need to render some visualization but not using the whole dataset, i need to use sampled data instead of the full dataset, if there is a way to do this, can you please help me with an examle?


#2

Well i need to know what type of provider are you using, but, if you are using a SQL povider you can do it using custom queries, here is an example:

let providers = [{
    name: 'redshift',
    provider: 'redshift',
   // other configs
    metadata: {
        'custom_query': {
            query: `
            SELECT * FROM public.ticket_sales TABLESAMPLE BERNOULLI(1)
    `
        }
    }
}];

In this case we are showing 1% of the content of a ticket_sales table


#3

You’re right I didn’t talk about my source, well I’m using bigquery but I got the idea and for biguqery the query is something like this:

SELECT * FROM dataset.my_table SAMPLE SYSTEM TABLE (10 PERCENT)

I tried your recommendation and it works fine for me, so thanks for the help.


#4

Yes it should work with bigquery, well I’m glad it helped you