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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Script Line Error

Hi All,

I am getting a script line error while using Peek function to create a variable :

LET vCount3

= Peek('MyField', $(vCount2),'Test1');

Where

LET vCount2 = '$(vCount1)/2';
LET vCount1
= 'Count(Distinct MyField)';

Thanks!

11 Replies
maxgro
MVP
MVP

I think Albert is correct, vCount1 is wrong and so you don't get an integer in vCount2 and Peek doesn't work

Not applicable
Author

Variable vCount1 is used (in vCount2) before it is assigned a value.

Also, although vCount1 contains a 'string', its value when evaluated in vCount2 will return a null, since a field value count cannot be computed like the way it is done.