Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
thanstad
Creator
Creator

IntervallMatch

Based on daily data from a TV distributor, they offer people to rent movies. I have a discrete table with a Date_Time stamp when a movie is rented. The discrete table does not have a start and end time for rental, but I was thinking about generate a INLINE table with four different timeintervalls. I have not succeded on this, Can anyone give me a hint how to cope with this. The onle exmples I have seen is based on Start and End time in the transactionsdata.

Tormod Hanstad

2 Replies
swuehl
MVP
MVP

Sorry, I don't understand what you want to do here.

You have a transaction table with purchase timestamps, ok.

How do you want to determine the length of the rental from that? Are there any conditions they sign?

If you know the allowed rental period, you can just create a new field for the end date adding the rental period to the start timestamp:

Let vRentalPeriod = 2.5; // days

LOAD Xstream_Purchase__User_ID,

     Xstream_Purchase__Date,

     Xstream_Purchase__Time,

     Xstream_Purchase__Movie_ID,

     timestamp(Xstream_Purchase__Date+Xstream_Purchase__Time) as PurchaseDateTime,

     timestamp(Xstream_Purchase__Date+Xstream_Purchase__Time+$(vRentalPeriod)) as RentalEndDateTime

FROM

[IntervallMatch.xlsx]

(ooxml, embedded labels, table is Sheet1);

thanstad
Creator
Creator
Author

Thanks for reply and suggestion. Well I was thinking about to split the Date/Time into groups Morning,Afternoon, Night etc. But I see now that an loose table generated by inline with this groups and use this one to make this split.

Split_hrs:

LOAD INLINE[Group,Description

0,Morning

1,Afternoon

2,Evening

3,Night

];

Tormod