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: 
Not applicable

PEEK does not work on inline table ?

Hi,

In the example below, the variable vSPOTReloadDate remains empty after the PEEK statement. When I try the PEEK function with a 'normally' loaded table, it works just fine. The SPOTProperties table get loaded fine.

I can't find this limitation in the docs. Is this by design or am I missing something here ?

Any help would be greatly appreciated.

Jan

LET vSPOTDate = MakeDate(2010,4,9);
LET vSPOTTime = MakeTime(12,23,56);

SPOTProperties:
LOAD * INLINE
[PropertyID, PropertyName, PropertyValue
0,SPOTReloadDate,$(vSPOTDate)
1,SPOTReloadTime,$(vSPOTTime)];

LET vSPOTReloadDate = Peek('PropertyValue', 0, 'SPOTProperties');

1 Solution

Accepted Solutions
Not applicable
Author

I have the solution :

a QUALIFY statement occured before the code sample I posted. So the correct syntax is :

LET vSPOTReloadDate = Peek('SPOTProperties.PropertyValue', 0, 'SPOTProperties');

So even though the PEEK function takes a 'tablename' as parameter, the fieldname needed to be fully qualified.

View solution in original post

7 Replies
sparur
Specialist II
Specialist II

Hello Jan.

try that code:

LET vSPOTDate = MakeDate(2010,4,9);
LET vSPOTTime = MakeTime(12,23,56);

SPOTProperties:
LOAD

*,

IF( PropertyID = 0, $(vSPOTDate), $(vSPOTTime)) AS PropertyValue

INLINE
[PropertyID, PropertyName
0,SPOTReloadDate
1,SPOTReloadTime];

LET vSPOTReloadDate = Peek('PropertyValue', 0, 'SPOTProperties');

sparur
Specialist II
Specialist II

I create a small example.

Not applicable
Author

Hi Anatoly,

thanks for your quick answer!

Your solution works fine indeed, I just don't understand why ? For Qlikview, what is the difference between our solution (internally I mean)

Jan

sparur
Specialist II
Specialist II

I think that in INLINE table Qlikview can't evaluate a variable.

Not applicable
Author

I think it can, because if you open the table viewer and do a 'preview' the data is loaded into the table correctly.

I copied my code into a new empty project and there it works fine. It must be something else in my project messing things up.

Thanks for your help!

Jan

Not applicable
Author

I have the solution :

a QUALIFY statement occured before the code sample I posted. So the correct syntax is :

LET vSPOTReloadDate = Peek('SPOTProperties.PropertyValue', 0, 'SPOTProperties');

So even though the PEEK function takes a 'tablename' as parameter, the fieldname needed to be fully qualified.

sparur
Specialist II
Specialist II

Yes, you are right. Inline can evaluate variable. But I didn't understand why you use an QUALIFY statement?