Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
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

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

Specialist II
Specialist II

I create a small example.

Not applicable

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

Specialist II
Specialist II

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

Not applicable

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

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

Specialist II
Specialist II

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