Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I have a table with field Date_time:
Column Date_time has a timestamp format.
I want to expand the table with 1 minute time interval up to e.g. 2 minutes backward and forward..
It is possible that backward and forward will be done up to 10 or 20 minutes, depending on the circumstances.
Could you demonstrate how to solve in the script?
Best regards,
Cornelis
Maybe something like this:
LOAD ID,
Timestamp(Date_time+ (iterno()-3)*(1/(24*60))) as Date_time
FROM
[https://community.qlik.com/servlet/JiveServlet/download/1120647-244677/Datetime%20iteration.xlsx]
(ooxml, embedded labels, table is LOAD)
While Iterno() <= 5
;
ID | Date_time |
---|---|
1 | 30.08.2016 18:20:00 |
1 | 30.08.2016 18:21:00 |
1 | 30.08.2016 18:22:00 |
1 | 30.08.2016 18:23:00 |
1 | 30.08.2016 18:24:00 |
2 | 02.09.2016 06:57:00 |
2 | 02.09.2016 06:58:00 |
2 | 02.09.2016 06:59:00 |
2 | 02.09.2016 07:00:00 |
2 | 02.09.2016 07:01:00 |
Maybe something like this:
LOAD ID,
Timestamp(Date_time+ (iterno()-3)*(1/(24*60))) as Date_time
FROM
[https://community.qlik.com/servlet/JiveServlet/download/1120647-244677/Datetime%20iteration.xlsx]
(ooxml, embedded labels, table is LOAD)
While Iterno() <= 5
;
ID | Date_time |
---|---|
1 | 30.08.2016 18:20:00 |
1 | 30.08.2016 18:21:00 |
1 | 30.08.2016 18:22:00 |
1 | 30.08.2016 18:23:00 |
1 | 30.08.2016 18:24:00 |
2 | 02.09.2016 06:57:00 |
2 | 02.09.2016 06:58:00 |
2 | 02.09.2016 06:59:00 |
2 | 02.09.2016 07:00:00 |
2 | 02.09.2016 07:01:00 |
Hello Stefan,
Yes, thsi is the solution.
I thought it is something with iterno() funcion like this:
interval(rangemin(Eind, floor(Start) + IterNo() ) - rangemax(Start,floor(Start) + IterNo() -1),'hh:mm') as Duration
Resident Input2
While floor(Start)+IterNo()-1 <=Eind;
but this is based on days and you have solved it with
Timestamp(Date_time+ (iterno()-3)*(1/(24*60)))
Thanks for your quick help
Best regards,
Cornelis