Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

IntervalMatch() trouble

Hi,

I am trying to use the IntervalMatch() function - the advanced version with keyfields to compare - but it isn't working - well, QlikView is generating the table, but it has 0 records.

What I do is this:

- First I load a master_calendar from a qvs_file that has a field called %Datum.

- Then I load a table with intervals and some more keyfields and some more data from a qvd (I concatenate the three keyfields
   into one)

=> Now I would like to use that function to have the right interval (and keyfields) for every day.

=> So I write

IntervalMatch (%Datum, Key)

LOAD

       Interval_start,

       Interval_end,

       Key

RESIDENT ... ;

I realized that field %Datum is already formatted while both Interval_start and Interval_end are in numeric format - I have already replaced that. Still the resulting table has 0 records. The maximum Interval_end also is Today().

Can anyone spot what I have omitted here?

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
datanibbler
Champion
Champion
Author

Ah, I see. If I specify any keyfields, those would have to be in my master_calendar - which they are not of course, they are specific to that history_table.

So I have to first split up all intervals - I can use DISTINCT there avoid splitting the very same interval several times - and then I have to join that.

Let's see ...

p.S.: Where does the DISTINCT keyword have to go then? In the IntervalMatch_LOAD?

View solution in original post

1 Reply
datanibbler
Champion
Champion
Author

Ah, I see. If I specify any keyfields, those would have to be in my master_calendar - which they are not of course, they are specific to that history_table.

So I have to first split up all intervals - I can use DISTINCT there avoid splitting the very same interval several times - and then I have to join that.

Let's see ...

p.S.: Where does the DISTINCT keyword have to go then? In the IntervalMatch_LOAD?