Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I hope someone can help me. I am generating a Load Script which has seconds interval between 8/8/2011 to 8/21/2011.
Something like this...
StartTime | EndTime |
08/08/2011 00:00:01 | 08/08/2011 00:00:05 |
08/08/2011 00:00:06 | 08/08/2011 00:00:10 |
08/08/2011 00:00:11 | 08/08/2011 00:00:15 |
My idea is to use the TimeStamp Function and format the numbers. Please suggest if there is better approach. I understand I can quickly do it in Excel but I wanted to achieve this in QV.
Thanks in advance.
Cheers - DV
Hi D V,
try something like this:
LOAD
timestamp(daystart(makedate(2011,8,8))+(recno()-1)*5/(60*60*24)+1/(60*60*24)) as starttime,
timestamp(daystart(makedate(2011,8,8))+(recno()*5/(60*60*24))) as endtime
autogenerate 60/5*60*24*13;
Regards,
Stefan
Hi, DV
This is the script you need. You may need to adjust the limits.
load MakeDate(2011,8,8)+ rowno()/24/60/12 as end,
(MakeDate(2011,8,8)+ (rowno()-1)/24/60/12)+(1/24/60/60) as start
AutoGenerate( (MakeDate(2011,8,21) - MakeDate(2011,8,8) ) * 24 * 60 * 12 );
The ideia, is to use autogenerate to create as many lines as you want. Then, I use rowno() to increase the timestamp according to the line within the loop.
To add 5 seconds, imagine that a date or a timestamp is an integer where each day is equal to 1. Then, 1 second is 1/24/60/60 and 5 seconds is 1/24/60/12
Hope it helps,
Erich
Thanks guys. This is more complex than I have asked. Because the StartDate and EndTime change and also the interval time changes dynamically. I'll come back to you guys with more questions.
Many thanks again for your help.
Erich - I hope you are doing well. Nice to see you active on community.
Cheers - DV