Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
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');

Tags (2)
1 Solution

Accepted Solutions
Not applicable

PEEK does not work on inline table ?

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.

7 Replies
sparur
Valued Contributor II

PEEK does not work on inline table ?

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
Valued Contributor II

PEEK does not work on inline table ?

I create a small example.

Not applicable

PEEK does not work on inline table ?

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
Valued Contributor II

PEEK does not work on inline table ?

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

Not applicable

PEEK does not work on inline table ?

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

PEEK does not work on inline table ?

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
Valued Contributor II

PEEK does not work on inline table ?

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