Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate periods of different categories in the script

Hello everybody,

I stand in front of a larger data calculation problem is that I also due to a very large amount of data in the script

and do not want to have calculated on the surface of QlikView. Calculations on the surface are unfortunately now

even with a test database computationally intense. An application with the final data would thus tend not useful.

As an example, I've listed 4 periods here that somehow includes all together:

case number        category        interval

Case 1            A                10/01/10 - 31/01/10

Case 1            B                02/05/10 - 28/02/10

Case 1            C                22/02/10 - 05/03/10

Case 1            A                04/03/10 - 05/03/10

These periods are currently associated with a case number ("Case 1") within a table together

I want the one hand, the total number of calendar days (for the case 1 = 51 days) capture and on the other hand the

number of days the individual intervals capture (A 24 + B 24 + C 14).

Does anyone have any idea how this can be accomplished in the script? Would appreciate a few hints very much!

4 Replies
Not applicable
Author

Hi Gerald,

Im sure there are ways to do its both more pretty and efficient but this should do the trick

Good luck!

Anonymous
Not applicable
Author

Hi Hampus,

thank You. The problem is, that I can get the max and min from the categories and the interval for each

data set. I'm searching for evry single day. Breaks shouldn't be included in the calculation.

The next problem is, that the following table would be very very large because there are more

data sets in my data base that describe payments (with different typs of accounts). These are connected

to periods and to case numbers. ... This results in a very huge table with maybe some million data sets.

Not applicable
Author

Hi Gerald,

The field 'NumberOfDaysCase' shows the the number of days without any breaks, in this case 54. Is that incorrect?

If you have allot of other connecting fields that are of interest would it maybe be a good idea to break it out to a linked tabled instead or ,where you do the needed calculations, instead of joining it to the main table?

Anonymous
Not applicable
Author

Hi Hampus,

the case counts 51 different days and there is a break of 4 days in between.

The calculations with the intervals are correct if you ad 1.

My data base consits of periods of insurance connected thru policyholders.

The policyholders are connected with cases. Different events and payments are

linked with the cases. So there are three diffenent typs of times.

For example:

I want to look up some old cases in the first insurance period of person A.

If I select the first period my calculation should only calculate the payments

connected to this period of time respectively sum up, if there is an overlap.

Accordingly for case events and payments.


Actually I work with aggregations and if-conditions. Cause I sometimes compare

calendar days with these periods and count them, this is computationally intensive.

Especially I have only a testing data base yet.