Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to select random records to load into qvw?

Hi,

I have records in two sheets in excel file.

Sheet A have records 20,000 from jan 2011 to June 2012 and sheet B have records 10,000 from  july 2012 to current  which is sorted based on date in both sheets.

I created qvw. How can I select to reload the data into qvw with selection of random records in both sheets without depending on sorted date?

Could anyone suggest me please.

Thanks.


17 Replies
Not applicable
Author

Hi Amelia,

maybe:

1. load all data into tmp tables, adding new field with random value

2. order data by value from random field created in point 1 and load first x rows

3. drop tmp tables

regards

D

ashfaq_haseeb
Champion III
Champion III

Hi.

What do you mean by random record?

In qlikview we can read data till specific line.

try below code

LOAD*

FROM

test.xlsx

where RecNo()<59;

Regards

ASHFAQ

Anonymous
Not applicable
Author

See sample load (or select):

SAMPLE 0.25 LOAD * FROM ...

It loads 25% of randomly selected records.

Not applicable
Author

But the number (0.25) is not percent of rows which will be loaded, but probability, that particular row will be loaded.

regards

Darek

Colin-Albert
Partner - Champion
Partner - Champion

Michael Solomovich That's a useful command I had not come across before!

I was considering an approach like Dariusz Mielczarek suggested, but Sample is far simpler to implement.

its_anandrjs
Champion III
Champion III

Thanks Michael for the command i also did not use it ever but while using it decrease the original table rows and load the table, it will so help ful where we need to load some data. But when data need to be loaded randomly like first 100 and then from 300 to 500 and then again from 101 upto i believe it not works.

Thanks & Regards

Anonymous
Not applicable
Author

Correct Darek, I simplified explanation
On the large number of records it is more or less the same.

Not applicable
Author

Of course,

+/- one or two%...

Anyway, helpful command and i also didn't meet it b4

Thanks Michael

ThornOfCrowns
Specialist II
Specialist II

Thanks to Michael Solomovich for another neat tip!