Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert Date time into Seconds in Qlikview.

Hi,

Can any one please suggest me how to convert [ Date Time] into Seconds while loading the script:

Ex: I have a column with Generate time and start time and than Elapsed time as time interval between start and generate, I want to split the rows with Elapsed time (30 secs) into 30 different rows with row one as 1 sec and row 2 as 2 secs and 3 as 3 secs and so on (This is for Analysis purpose) .

If any one can suggest how to convert the date time into complete seconds,  so that I can use iterno() function to loop through and generate the records.

Thanks and Regards

SR

9 Replies
Anil_Babu_Samineni

May be this?

Load Interval(Start, 'ss') + IterNo() - 1 as Start

While Interval(Seconds, 'ss') + IterNo() - 1 <= Interval(Generate, 'ss')

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

Hi Anil, the scenario is like this:

starttime= 25/09/2017 15:10:20

Endtime= 25/09/2017 15:11:09

Elapsed time = 63 seconds ( endtime-starttime)

Now I want to generate a column which splits the elapsed time into 1 to 63 seconds ( 63 rows expected) and with a session id Unique key of course. so the new row should split the elapsed time into 1,2,3....63 seconds , I expecting a looping function to do this .......

Regards

Anonymous
Not applicable
Author

Hi Anil ,

Or the best way is to convert 25:09:2017 15:10:20 completely into Seconds and then loop through the initial values till th..Ifff

sunny_talwar

While is a looping function in the script... check this out

Loops in the Script

Anonymous
Not applicable
Author

Hi Sunny, its looping but with a complication:

I have 25:09:2017 15:20:30 as start date  and

I have 25:09:2017 15:24:45 as End date

Elapsed time is end date-start date 63 secs for example.

I am  looking for an extra column which reads elapsed time  in descending order until it reaches 63 (which means 63 rows for one Session id......

I Hope its helpful

Regards

Anil_Babu_Samineni

PFA

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

Thanks Anil

Anonymous
Not applicable
Author

Thanks Sunny

Anil_Babu_Samineni

Your issue resolved? So, Please mark it as correct answer and make some helpful answers in this thread if respect to issue

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)