Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
bimanbeginner
Contributor II
Contributor II

Interval Match

Hi

I am trying to create a range between my min and max timestamps.

this script works when using dates, but for some reason when I use timestamp it gives me the bellow error

is it my variables that need a format change because of the timestamp? or what could it be???

I appreciate your assistance

Error in expression:

')' expected

TimeStamp:

LOAD date(2017/06/01 00:00:00+recno()-1) as "TimeRange"

AUTOGENERATE 2017/06/12 06:12:39-2017/06/01 00:00:00+1

Tasks:
Load * ,
Timestamp(([Timestamp to] -[Timestamp From]),'hh:mm:ss') as TaskDuration


Resident TasksNew;
Drop Table TasksNew;


Min:
LOAD min(Timestamp(("Timestamp From"),'YYYY/MM/DD hh:mm:ss')) as "Min Date"
;
LOAD fieldvalue('Timestamp From',iterno()) as "Timestamp From"
AUTOGENERATE 1
WHILE len(fieldvalue('Timestamp From',iterno()))
;
Max:
LOAD max(Timestamp(("Timestamp to"),'YYYY/MM/DD hh:mm:ss')) as "Max Date"
;
LOAD fieldvalue('Timestamp to',iterno()) as "Timestamp to"
AUTOGENERATE 1
WHILE len(fieldvalue('Timestamp to',iterno()))
;
LET vMin = fieldvalue('Min Date',1);
LET vMax = fieldvalue('Max Date',1);

TimeStamp:
LOAD date($(vMin)+recno()-1) as "TimeRange"
AUTOGENERATE $(vMax)-$(vMin)+1
;

LEFT JOIN (Tasks)
INTERVALMATCH (TimeRange)
LOAD
"Timestamp From"
,
"Timestamp to"
RESIDENT [Tasks]
;
DROP TABLES
Min
,Max
,TimeStamp
;

10 Replies
sunny_talwar

I showed you the while approach in another post, is that not working for you?