Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Peek function to pick a date

Hi

I am using the following line code to pick a date using peek function.

LET vDate=Peek('DateFeild',$(i),'DateTable');

And I want to use the variable vDate in LOAD statement. After execution, the table which loaded has decimal values instead of dates.

I want to get the exact dates.  Its because Peek function returns a string.  I am not able to figure out a way to get the date value when I use in LOAD statement.

Thanks in advance.

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Peek function to pick a date

Try using single quotation marks around the variable:

'$(vMDMTargetDate)' as vDate

The number you get is 6 divided by 17 divided by 2011 ( 6/17/2011 ), QlikView expands the variable and then tried to evaluate the expanded.

Hope this helps,

Stefan

6 Replies
MVP
MVP

Peek function to pick a date

Hi,

i think DATE function would help you. Can you upload sample application?

Regards,  tresesco

MVP
MVP

Peek function to pick a date

The variable holds the numerical representation of the value retrieved from the DateField, so I think this is ok.

When you recall the variable value, you could use Date() function then to format the date, like

LOAD

...

Date($(vDate)) as PeekedDate,

....

from ...

to format it with standard date format (or specify the format code string as second parameter in Date() function).

Hope this helps,

Stefan

Not applicable

Re: Peek function to pick a date

Nope date function didnt work.

Attached please find the sample. I would appreciate any help.

Thanks

Highlighted
MVP
MVP

Peek function to pick a date

Try using single quotation marks around the variable:

'$(vMDMTargetDate)' as vDate

The number you get is 6 divided by 17 divided by 2011 ( 6/17/2011 ), QlikView expands the variable and then tried to evaluate the expanded.

Hope this helps,

Stefan

MVP
MVP

Peek function to pick a date

Hi,

it seems that your source file has timestamp for date field as in [Date of Delivery] and it is not being taken in right format for date. can sample source files(csv) be uploaded?

Regards,  tresesco

Not applicable

Re: Peek function to pick a date

Thanks guys single quotation mark around the variable worked!

thanks again guys.

Community Browser