Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

How to use a varibale in peek?

Hi

I was trying to follow some other post of how to generate a random value to check but I can´t get the variable to work. Can some of you se what I´m doing wrong?

/Thanks

(http://community.qlik.com/thread/61424?tstart=30)

Load:

KKIK:

KKIK_Key,

ID,

....

From...

 

LET RandomRow = round(Rand()*(NoOfRows(KKIK_Key)));

KKIK_RandomCheck:

LOAD

peek('KKIK_Key',$('RandomRow'),'KKIK') as KKIK_Key,       

peek('KKIK_Key',$('RandomRow'),'KKIK') as KKIK_Random_ID

//peek('KKIK_Key','1','KKIK') as KKIK_RandomCheck_ID        <---- This works, gives me a id to check on

AutoGenerate 1;

1 Solution

Accepted Solutions
MVP
MVP

Re: How to use a varibale in peek?

Have you tried

peek('KKIK_Key',$(RandomRow),'KKIK') as KKIK_Key

edit:


and check also the variable created, I think I would use something like

LET RandomRow = floor(Rand()*(NoOfRows('KKIK_Key')));

3 Replies
MVP
MVP

Re: How to use a varibale in peek?

Have you tried

peek('KKIK_Key',$(RandomRow),'KKIK') as KKIK_Key

edit:


and check also the variable created, I think I would use something like

LET RandomRow = floor(Rand()*(NoOfRows('KKIK_Key')));

whiteline
Honored Contributor II

Re: How to use a varibale in peek?

My fault with round(), thanx.

Not applicable

Re: How to use a varibale in peek?

Hi. Sorry for late replay but was gone for the weekend. Thanks for the help!

Community Browser