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

set analysis on time intervals

Hi,

I am trying to count the number of occurence of an element inside the date interval calculated on another element.

Something like:

- select an element

- the start time are filtered

- input box: range in seconds of the interval

- table with start time as dimension and count of the second element's start time inside the interval (first element's startTime +/- Range)calculated by range as expression

The expression: count({$<X.StartTime={">$(=X:StartTime - range) <$(=X:StartTime + range)"},element={"second element"}>} X.StartTime)

it's not working because QlikView it is not able to refere to each StartTime row values but only to a specific StartTime value.

I tried also to add the StartTime as expression and refer to it inside the set analsys with the Column(1) function but it seems that it is not possible to do it.

Have you got any idea to suggest?

Thank you.

Davide

4 Replies
swuehl
MVP
MVP

I also believe that you can't use set analysis here, since you want to use the dimension value to filter your records, but using good old if() clauses inside your count should work (may not be very performant though).

I am not sure how your second element's start time etc. is defined, so it would be good if you could post some lines of sample data, best together with your expected result, then it should be easy to help you with the syntax of your count( if( INTERVALCONDITION , X.StartTime)).

Not applicable
Author

Hi swuehl,

Attached an example of the desired table.

The dimension is: Start Time

The expression should be (something like):

count({$<X.StartTime={">$(=X.StartTime - range) <$(=X.StartTime + range)"},Events.Description={"Second Element Name"}>} X.StartTime)

We expect, as result, the same table with all the start time of the second element in the neighborhood of the first element.

The range variable is setted by the users.

Currently that table display only all the start time of the second element equals to the start time of the first element.

Best regards,

Davide

swuehl
MVP
MVP

Your dimension is StartTime, is X.StartTime a different field or just the correct, qualified field name of StartTime? Are first and second element located in different tables and linked via a Key field or maybe in one table in one raw with different StartTime entries or in one table, different rows sharing the StartTime field (e.g. are first and second element just two values in field Events.Description?)?

Well, it's still unclear to me how your data model looks like. It would be really best if you could post a small sample app or some sample lines / INLINE tables of your raw data.

Not applicable
Author

Hi,

attached the QVW document.

We have First and Second elements and all the Start Time's related.

We can assume that the range, for the example, is -/+ 5 seconds.

Regards,

Davide