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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
terezagr
Partner - Creator III
Partner - Creator III

IntervalMatch with different dates and conditions

Hi,

I have the following tables:

Fact_Table:  

       

CAP_SKASCAppDecFinal_DecINTERVAL_STARTINTERVAL_END
212468_UOOO1UNU679186679278
212468_UOOO1UAFUF679279679643
212468_UOOO1UAFUF679644679711
212468DTUOOO1UAFUF679712679713
212468DTUOOO1UAFUF679714678968

Calendar:

Hour_IDDateHour
67918625/10/2012 15:0015
67927929/10/2012 12:0012
67964413/11/2012 17:0017
67971216/11/2012 13:0013
67971416/11/2012 15:0015
67927829/10/2012 11:0011
67964313/11/2012 16:0016
67971116/11/2012 12:0012
67971316/11/2012 14:0014
67896816/10/2012 13:0013

I am performing an intervalMatch as follow:

FACT_TABLE:

LOAD

CAP_SK,

ASC,

App,

Dec,

Final_Dec,

INTERVAL_START,

INTERVAL_END

FROM FACT_TABLE.qvd(qvd);

CALENDAR:

LOAD

Hour_ID,

Date,

Hour

FROM Calendar.qvd(QVD);

IntervalMatch_FACT_TABLE:

IntervalMatch(Hour_ID)

LOAD

INTERVAL_START,

INTERVAL_END

Resident FACT_TABLE;

This creates an Interval Match with no problem. My problem after that is in the front-end of my application.

Example:

I want to see all applications between 25/10/2012 (INTERVAL_START)  and 16/11/2012 (INTERVAL_END).

As you can see above in the table Fact_Table, there should be 5 applications listed when I pick these two dates. What I end up having when I pick these two dates is just 1 application - and this relates to 25/10/2012 (INTERVAL_START). INTERVAL_END seems not to be taken into consideration.

Is there any way how to do this in front end by using set analysis?

1 Solution

Accepted Solutions
terezagr
Partner - Creator III
Partner - Creator III
Author

Thanks Ramon!

In the end I have used the following expressions and it worked

For Interval Start dates:

=(DATE(min({<ACT_DATE={">=$(INTERVAL_END)"}>}DATE)))

For Interval End dates:

DATE(max({<ACT_DATE={"<=$(INTERVAL_START)"}>}DATE))

View solution in original post

2 Replies
ramoncova06
Partner - Specialist III
Partner - Specialist III

terezagr
Partner - Creator III
Partner - Creator III
Author

Thanks Ramon!

In the end I have used the following expressions and it worked

For Interval Start dates:

=(DATE(min({<ACT_DATE={">=$(INTERVAL_END)"}>}DATE)))

For Interval End dates:

DATE(max({<ACT_DATE={"<=$(INTERVAL_START)"}>}DATE))