Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jrbrutto
Contributor II
Contributor II

Peek as expression

Hi,

New using Peek and I found a problem with that:

Using variables (Peek1 attachement) result is not populated

Using hardcoded values (Peek2 attachment) result is populated correctly

Any suggestions? Thanks

 

 

Labels (1)
1 Solution

Accepted Solutions
jrbrutto
Contributor II
Contributor II
Author

I tried all possible mix with quotes and no-one works

Let vStation= peek($(vStationTableField),$(k),$(vStationName))

Let vStation= peek('$(vStationTableField)',$(k),$(vStationName))

Let vStation= peek($(vStationTableField),$(k),'$(vStationName)')

Let vStation= peek('$(vStationTableField)',$(k),'$(vStationName)')

At the end I found as acceptable solution the following

// PEEK DATA FROM STATIONS
LET variablea = Peek('TABLE_FIELD_A',$(k),'TABLE_STATIONS_A');
LET variableb = Peek('TABLE_FIELD_B',$(k),'TABLE_STATIONS_B');
LET vresult = if(n = '1', variablea , if(n = '2', variableb )); 

View solution in original post

7 Replies
pradosh_thakur
Master II
Master II

Try

Let vStation= peek($(vStationTableField),$(k),$(vStationName)); // I have deleted the ' as the output already has it
if this doesn't work send the screenshot for the below
let v1 = '$(vStationName)';
let v1 = '$(vStationTableField)';
Learning never stops.
jrbrutto
Contributor II
Contributor II
Author

Hi Tried but is doesn't works.

Attached you can find fields values.

I ran two times one with our solution and one with fields values hard-coded.

When it's used as variables vStation result fail (NULL), when it's used hard-coded it works perfectly.  

 

pradosh_thakur
Master II
Master II

hi

if you see carefully your $(vStationTableField) already has single quotes. You should not use it inside the peek expression. so may be try to not use single quotes in the expression of the variable itself.

peek(field name_without single_quotes,$(k),table_name_in_single_quotes)

can you please write the expression of both the variable.
Learning never stops.
jrbrutto
Contributor II
Contributor II
Author

Hi,

Attached you can find peek without quote but it doesn't work either.

 

jrbrutto
Contributor II
Contributor II
Author

Hi,

Attached you can find peek without quote but it doesn't work either.

 

pradosh_thakur
Master II
Master II

I guess you didn't understand me. Can you just write the expression for vStationTableField and vStationTable for me. I will change a couple of things and you can try that

Please try the above in an extra app and not the main app itself.
Learning never stops.
jrbrutto
Contributor II
Contributor II
Author

I tried all possible mix with quotes and no-one works

Let vStation= peek($(vStationTableField),$(k),$(vStationName))

Let vStation= peek('$(vStationTableField)',$(k),$(vStationName))

Let vStation= peek($(vStationTableField),$(k),'$(vStationName)')

Let vStation= peek('$(vStationTableField)',$(k),'$(vStationName)')

At the end I found as acceptable solution the following

// PEEK DATA FROM STATIONS
LET variablea = Peek('TABLE_FIELD_A',$(k),'TABLE_STATIONS_A');
LET variableb = Peek('TABLE_FIELD_B',$(k),'TABLE_STATIONS_B');
LET vresult = if(n = '1', variablea , if(n = '2', variableb ));