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: 
qw_jakub
Partner - Contributor III
Partner - Contributor III

Measure on an interval in a SCD Table

Hello,

What is the best way to compute a measure on data from an SCD table?

I know how to compute a measure when a fact table is involved, but am having a trouble in extracting information from the SCD table itself.

Let's say the columns are like this:

IDInterval_IDCategorystart-activeend-activeFromDateToDate

and i need to find out how many IDs were active (in the interval between start-active and end-active) in a given time period.

That is I need to pick the valid records for the period  based on [FromDate], [ToDate] and then count the active IDs based on [start-active], [end-active].

Any tips on how to achieve this in the load script and/or expression would be very helpful.

See the attached qv file for my test data.  Thanks!

IDInterval_IDCategorystart-activeend-activeFromDateToDate
11A28.4.20102.5.20101.1.19903.5.2010
12A4.5.20104.6.20104.5.20109.5.2010
13B4.5.20104.6.201010.5.201031.1.2099
24A20.4.201015.5.20101.1.19908.5.2010
25B20.4.201015.5.20109.5.201020.5.2010
26B21.5.20101.6.201021.5.201031.1.2099
37B20.4.20103.5.20101.1.19909.5.2010
38B10.5.201025.5.201010.5.201015.5.2010
39A10.5.201025.5.201016.5.201028.5.2010
310A29.5.20104.6.201029.5.201031.1.2099
411A20.4.20105.5.20101.1.19907.5.2010
412A8.5.201025.5.20108.5.201015.5.2010
413B8.5.201025.5.201016.5.201020.5.2010
414B27.5.20105.5.201027.5.201031.1.2099
515B4.5.20104.6.20101.1.199031.1.2099
0 Replies