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: 
ananyaghosh
Creator III
Creator III

Peek function does not work for me

HI,

I am using the below code:

[Dim_Office_Updated_Date]:
load date(floor(max("UPD_TS")), 'DD/MM/YYYY') as "Max_Upd_Time" from $(vExtractPathName)\Dim_Office.qvd(qvd);
LET vMax_Updated_Time = peek('Max_Upd_Time', 0, 'Dim_Office_Updated_Date');

and get this value when I use the following variable in a text object:    =$(vMax_Updated_Time )

0.0024789291026277

But if I use the column  'Max_Upd_Time' in a list box it gives me correct result.

Please suggest what to do now.

Thanks,

Sandip

3 Replies
sasiparupudi1
Master III
Master III

Wrap the variable around Time function

Time($(vMax_Updated_Time ))


or

LET vMax_Updated_Time =Time(Peek('Max_Upd_Time', 0, 'Dim_Office_Updated_Date'));



hth

Sasi

marcus_sommer

Within a textbox use just: vMax_Updated_Time. The cause for your result are the '/' within your date-format which will divide your numbers against eachother within a $-sign expansion like for today:

03 / 03 / 2017 = 0.0005

But I think it would be better to remove the formatting by creating this field and variable and later if you call this variable you could add your needed format again.

- Marcus

Anvesh
Contributor III
Contributor III

Hi sandeep,

As said by Marcus, use formatting in function like

Date(Peek('Max_Upd_Time', 0, 'Dim_Office_Updated_Date'),'DD/MM/YYYY')


if still it does not work try to change default date formatting, which will be present in first tab.


Regards

Anvesh