Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Timestamp value loop question

I have a min/max date and need to create a value loop that I will used to list predefined values in a dropdown menu. It is not displaying the value correctly so I am testing it by outputting to a text box. I can't explain the results I am getting so looking for some assistence:

1. This works as expected:

Expression: = Timestamp(vMaxDate) & '  ' &  Timestamp(vMinDate)

Output:  12/11/2014 12:00:00 AM   5/31/2013 12:00:00 AM

2. This works as expected:

Expression: = Concat( Timestamp( Valueloop( Today(1)+2, Today(1), -(1/24) ) ) , ',' )

Output: 12/11/2014 10:00:00 AM,12/11/2014 10:00:00 PM,12/11/2014 11:00:00 AM,12/11/2014 11:00:00 PM,12/11/2014 12:00:00 AM,12/11/2014 12:00:00 PM,12/11/2014 1:00:00 AM,12/11/2014 1:00:00 PM,12/11/2014 2:00:00 AM,12/11/2014 2:00:00 PM,12/11/2014 3:00:00 AM,12/11/2014 3:00:00 PM,12/11/2014 4:00:00 AM,12/11/2014 4:00:00 PM,12/11/2014 5:00:00 AM,12/11/2014 5:00:00 PM,12/11/2014 6:00:00 AM,12/11/2014 6:00:00 PM,12/11/2014 7:00:00 AM,12/11/2014 7:00:00 PM,12/11/2014 8:00:00 AM,12/11/2014 8:00:00 PM,12/11/2014 9:00:00 AM,12/11/2014 9:00:00 PM,12/12/2014 10:00:00 AM,12/12/2014 10:00:00 PM,12/12/2014 11:00:00 AM,12/12/2014 11:00:00 PM,12/12/2014 12:00:00 AM,12/12/2014 12:00:00 PM,12/12/2014 1:00:00 AM,12/12/2014 1:00:00 PM,12/12/2014 2:00:00 AM,12/12/2014 2:00:00 PM,12/12/2014 3:00:00 AM,12/12/2014 3:00:00 PM,12/12/2014 4:00:00 AM,12/12/2014 4:00:00 PM,12/12/2014 5:00:00 AM,12/12/2014 5:00:00 PM,12/12/2014 6:00:00 AM,12/12/2014 6:00:00 PM,12/12/2014 7:00:00 AM,12/12/2014 7:00:00 PM,12/12/2014 8:00:00 AM,12/12/2014 8:00:00 PM,12/12/2014 9:00:00 AM,12/12/2014 9:00:00 PM,12/13/2014 12:00:00 AM

3. This doesn't work as expected:

Expression: = Concat( Timestamp( Valueloop( Timestamp(vMaxDate), Timestamp(vMinDate), -(1/24) ) ) , ',' )

Output: None

5 Replies
maxgro
MVP
MVP

it seems your third expression works

see attachment

Not applicable
Author

Yes, I am able to use yours, and made a few simple changes to help isolate the issue. It appears to depend on the space between Min/Max. I tried the following in the reload script:

// Works

let vMinDate = Timestamp( MakeDate(2014, 8, 1 ) );

let vMaxDate = Timestamp( today(1) );

// Doesn't work

let vMinDate = Timestamp( MakeDate(2014, 7, 1 ) );

let vMaxDate = Timestamp( today(1) );

// Works

let vMinDate = Timestamp( MakeDate(2014, 7, 1 ) );

let vMaxDate = Timestamp( MakeDate(2014, 9, 1) );

Peter_Cammaert
Partner - Champion III
Partner - Champion III

I think the explanation is simple: ValueLoop works with values, not dual() values (strings are discarded) nor string timestamps. Some constructs will refuse to produce date values and some constructs will refuse to produce anything, although the ValueLoop does work. For example, omit the outer TimeStamp call in your third expression, and suddenly the ValueLoop-Concat combo kicks in...

= Concat( Valueloop( Timestamp(vMaxDate), Timestamp(vMinDate), -(1/24) )  , ',' )

Also take care of not mistaking TimeStamp for TimeStamp# and vice-versa.

Peter

Not applicable
Author

Yes, the expression you listed does work to show all timestamps as values. Are you saying it is not possible to display each of these as a timestamp?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Apparently not. Everything I tried failed, unfortunately.