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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

Time Interval Help

hi Guys,

I have one scenario in which i getting data every second a day

i.e. 25-Sep-15 12:00:01 AM

     25-Sep-15 12:00:02 AM

     25-Sep-15 12:00:03 AM

     25-Sep-15 12:00:04 AM

     25-Sep-15 12:00:05 AM

     25-Sep-15 12:00:06 AM

      so on...

     25-Sep-15 01:00:01 AM

     25-Sep-15 01:00:02 AM

     25-Sep-15 01:00:03 AM

     25-Sep-15 01:00:04 AM

I want i to extract intervals between then like below

    

     25-Sep-15 02:00:01 AM

     25-Sep-15 01:00:01 AM

     25-Sep-15 03:00:01 AM

     25-Sep-15 04:00:01 AM

     25-Sep-15 05:00:01 AM


so on


Any Suggestion??



17 Replies
abhaysingh
Specialist II
Specialist II
Author

Please Revert...

SreeniJD
Specialist
Specialist

Hi Abhay,

As you may be aware that you can load your table first, and you can then add the script suggested by Marco with Resident table option.

HTH,

Sreeni

abhaysingh
Specialist II
Specialist II
Author

I tried in that way...

TxnTable:

Load

     Field1,

     DateRecorded,

     Temperature

From Source...

Concatenate(TxnTable)

Tran_Temp2:

LOAD *, 

    Timestamp(Floor(DateRecorded,'01:00:00','00:00:01'),'DD-MM-YY hh:mm:ss TT') as DateRecorded_Test,

    Timestamp(Floor(DateRecorded,'01:00:00','00:00:01'),'DD-MM-YY hh:mm:ss TT') as TimeInterval;

    

LOAD 

  Timestamp(Today()-2+IterNo()/86400,'DD-MM-YY hh:mm:ss TT') as DateRecorded

    Ceil(Rand()*1000) as "fact" 

AutoGenerate 1 

While (Today()-2)+IterNo()/86400<=Now();

With respect to DateRecorded_Test, I am not Getting Temprature..

Please Suggest

Abhay

jonathandienst
Partner - Champion III
Partner - Champion III

Its not clear what you are trying to do. Do you want to filter the TxnTable to get one reading per minute? If you supply some input data and the expected output, it might help.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
abhaysingh
Specialist II
Specialist II
Author

Hey Jonathan,

Pls find the sample data...

i m getting Date with time stamp for every second..

I need the output like Interval Time Below

12:00:00 AM     

01:00:00 AM

02:00:00 AM

and temperature w.r.t Interval Time..

Pls Suggest

Abhay

abhaysingh
Specialist II
Specialist II
Author

Pls Revert..

PrashantSangle

Hi,

Try

Timestamp(Date#(Date,'DD.MM.YYYY hh:mm:ss'),'DD/MM/YYYY hh:00:00 TT')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jonathandienst
Partner - Champion III
Partner - Champion III

Your times in your sample do not cover every second, but to load your sample:

LOAD Id,

     Date(Floor(Date#(Date, 'dd.MM.yyyy hh:mm:ss'))) As Date,                         //convert to pure date

     Time(Frac(Date#(Date, 'dd.MM.yyyy hh:mm:ss')), 'hh:mm:ss TT') As Time,  //convert to time in format requested

     Num(Num#(Temperature, '0,0', ',')) As Temperature                                     //read this as a number  

FROM

(biff, embedded labels, table is Sheet1$);

Still not clear what you want to do this.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein