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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with last date in IntervalMatch

Hi,

I am trying to do an interval match using this function:

left join(1_tmp)

IntervalMatch (transaction_date)

LOAD

     distinct date(from_date) as from_date,

     date(to_date) as to_date    

FROM

[..x.QVD]

(qvd)

from_date and to_date are the first and last date in every month. transaction_date is also a date(transaction_date).

All records from 1_tmp get an from_date and end_date except from the last date in every month.  All idéas are welcome!

Reagrds

Anna

1 Solution

Accepted Solutions
vincent_ardiet
Specialist
Specialist

Hi,

Are you sure that your transaction_date is not a timestamp containing hours ?

Try with :

left join(1_tmp)

IntervalMatch (transaction_date)

LOAD

     distinct date(from_date) as from_date,

     dayend(date(to_date)) as to_date   

FROM

[..x.QVD]

(qvd)

Regards,

Vincent

View solution in original post

4 Replies
qliksus
Specialist II
Specialist II

You can give a condition in the transaction_date like

if ( monthend(transaction_date) = transaction_date , null() , transaction_date )  as transaction_date

so by this in the 1_temp table the monthend in the transaction_date will be eliminated

Not applicable
Author

Hi,

Thanks for the tip but I don't really see how that would help. Wouldn't that just remove the last day of the month and the result be that the records with a null date won't get any from_date or to_date? Or do I miss something?

Anna

vincent_ardiet
Specialist
Specialist

Hi,

Are you sure that your transaction_date is not a timestamp containing hours ?

Try with :

left join(1_tmp)

IntervalMatch (transaction_date)

LOAD

     distinct date(from_date) as from_date,

     dayend(date(to_date)) as to_date   

FROM

[..x.QVD]

(qvd)

Regards,

Vincent

Not applicable
Author

Thanks, that helped!!