Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying generate timestamp for every 1 minute of interval between start date and end. I found the way of doing it but facing issue as in some scenario it is behaving strange. I am not sure if I am doing wrong , need your help.
I am running below script
Data:
LOAD *,
timestamp(Start_Date+MakeTime(0,IterNo()-1)) as Time
While Start_Date+MakeTime(0,IterNo()-1)<=End_Date;
LOAD * Inline [
Start_Date,End_Date
10/20/2020 10:00,10/20/2020 10:07 ];
For a interval defined above, I am getting correct output which is generating time from 10:00 to 10:07. But as soon as I put below interval with same script, it is not giving correct results.
Data:
LOAD *,
timestamp(Start_Date+MakeTime(0,IterNo()-1)) as Time
While Start_Date+MakeTime(0,IterNo()-1)<=End_Date;
LOAD * Inline [
Start_Date,End_Date
10/20/2020 11:00,10/20/2020 11:07 ];
Above script generates time only till 11:06 with missing 11:07. Not sure if it is bug or I am doing something wrong. Can you please advise?
Iterno() hasn't any inbuilt limitation else it will run as far as the while-condition is true. This means you should check this condition again if it's really based on a minute-difference between from and to.
Before - just check the set selections in your application if not any of them limit your view from the screenshot to the 8'th hour.
- Marcus
Dear @marcus_sommer ,
thank you very much for your answer. Unfortunately I could not find the problem.
But I made a very short example, using exactly your solution, maybe you could check it ?
This is the script :
The file is attached. I would be very happy if there is a solution to this problem.
Greetings
Jakob
Could it be, that "maketime" can only add 59 minutes at the "minutes-spot"? so we would need to go on with the "hour-spot"?
Yes, you couldn't use maketime() in this scenario because you didn't trigger the next hour if you reach 60 minutes - probably there would be also measures to implement such logic with maketime() but I think it would be far much complicated as necessary and therefore I suggest something like:
timestamp(floor(FromDate + (1/24/60 * (iterno()-1)), 1/24/60))
- Marcus