Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

harrywu1
New Contributor II

LOAD script : INLINE[data] with columns of random numbers ?

Hi experts,

I am building a new dashboard, so here I need to make up the numbers for simulation. But I am new to LOAD scripts.

For the desired result, I want to insert the random numbers in the column of 'Yield'.

What should the LOAD script look like to make it happen?  It's possibly to be done in one table, instead of creating two and combining them together?

What if the data source (i.e. Customer, Product) is from Excel file, what LOAD script should I put on, to fill in the random numbers in column 'Yield' ?

Any reference link or document that specializes in LOAD script?     Appreciate the help!

Desired result :    

CustomerProductYield
AAK-184.38%
AAMTx85.29%
BBT-1185.98%
BBT-2186.99%
BBX-1189.43%
CCD5590.56%
DDS12X90.69%
DDL11B91.33%
DDK33A94.63%
EEM98.19%
EEP1s98.55%

Table1:

LOAD * INLINE [

Customer,Product

A,AK-1

A,AMTx

B,BT-11

B,BT-21

B,BX-11

C,CD55

D,DS12X

D,DL11B

D,DK33A

E,EM

E,EP1s

];

RandomNumber:

LOAD

Rand()*(1-0.80) + 0.80 as RandomNumber

AutoGenerate(11);

Tags (1)
1 Solution

Accepted Solutions
kaanerisen
Contributor III

Re: LOAD script : INLINE[data] with columns of random numbers ?

Hi Harry,

You can add calculated fields to load part of Inline script.

LOAD *

,Rand()*(1-0.80) + 0.80 as Yield

INLINE [

Customer,Product

A,AK-1

A,AMTx

B,BT-11

B,BT-21

B,BX-11

C,CD55

D,DS12X

D,DL11B

D,DK33A

E,EM

E,EP1s

];

Hope it helps.

2 Replies
kaanerisen
Contributor III

Re: LOAD script : INLINE[data] with columns of random numbers ?

Hi Harry,

You can add calculated fields to load part of Inline script.

LOAD *

,Rand()*(1-0.80) + 0.80 as Yield

INLINE [

Customer,Product

A,AK-1

A,AMTx

B,BT-11

B,BT-21

B,BX-11

C,CD55

D,DS12X

D,DL11B

D,DK33A

E,EM

E,EP1s

];

Hope it helps.

harrywu1
New Contributor II

Re: LOAD script : INLINE[data] with columns of random numbers ?

Thanks!  Can't believe that's so easy!

Community Browser