Skip to Content

Time slices

Time slices is an important concept in EDM. Several issues which I have encountered stems from an incorrect time slice selection or comparison, these incorrect time slices issues may be difficult and tricky to find, therefore it is recommended to use the correct time slice selection right from the start.

There can be several time slices scenarios in EDM which will be documented below. For time slices comparison there will always be 2 slices to compare. The slice below is known as the reference time slice, which means that any slices which falls within this reference time slice is required to be processed. An example of how a reference time slice spans is below. (AB = start date, BIS = end date)

/wp-content/uploads/2015/10/reference_811700.jpg

The below examples would be the scenarios which may happen when processing time slices. There are total of 9 possible scenarios. The yellow box will represent the 2nd time slice.

Scenario 1 : Start date < AB and End Date < BIS


/wp-content/uploads/2015/10/s1_811702.jpg



Scenario 2 : Start date > AB and End Date > BIS

/wp-content/uploads/2015/10/s2_811756.jpg

Scenario 3 : Start date > AB and End Date < BIS


/wp-content/uploads/2015/10/s3_811823.jpg


Scenario 4 : Start date < AB and End Date > BIS


/wp-content/uploads/2015/10/s4_811824.jpg


Scenario 5 : Start date = AB and End Date > BIS


/wp-content/uploads/2015/10/s5_811825.jpg


Scenario 6 : Start date < AB and End Date = BIS


/wp-content/uploads/2015/10/s6_811826.jpg


Scenario 7 : Start date = AB and End Date = BIS


/wp-content/uploads/2015/10/s7_811827.jpg


Scenario 8 : Start date = AB and End Date > BIS


/wp-content/uploads/2015/10/s8_811828.jpg


Scenario 9 : Start date > AB and End Date = BIS


/wp-content/uploads/2015/10/s9_811829.jpg


In order to achieve the time slice comparison of all 9 scenarios, the condition would be quite lengthy.

IF (Start date < AB and End Date < BIS) OR

(Start date > AB and End Date > BIS) OR

(Start date > AB and End Date < BIS) OR

(Start date < AB and End Date > BIS) OR

(Start date = AB and End Date > BIS) OR

(Start date < AB and End Date = BIS) OR

(Start date = AB and End Date = BIS) OR

(Start date = AB and End Date > BIS) OR

(Start date > AB and End Date = BIS).

In order to shorten these 9 scenarios, the code below can be used.

IF (Start date <= BIS and End date >= AB)


The below table will confirm the validity of the shortened code for the 9 scenarios.

Scenario

Reference time slice code

Shortened time slice code

Valid?

1

Start date < AB and End Date < BIS

Start date <= BIS  and End Date >= AB

Y

2

Start date > AB and End Date > BIS

Start date <= BIS  and End Date >= AB

Y

3

Start date > AB and End Date < BIS

Start date <= BIS  and End Date >= AB

Y

4

Start date < AB and End Date > BIS

Start date <= BIS  and End Date >= AB

Y

5

Start date = AB and End Date > BIS

Start date <= BIS  and End Date >= AB

Y

6

Start date < AB and End Date = BIS

Start date <= BIS  and End Date >= AB

Y

7

Start date = AB and End Date = BIS

Start date <= BIS  and End Date >= AB

Y

8

Start date = AB and End Date > BIS

Start date <= BIS  and End Date >= AB

Y

9

Start date > AB and End Date = BIS

Start date <= BIS  and End Date >= AB

Y

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply