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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

set analysis within a dimnesion interval in chart

Hi,

I'm struggling with an interval problem in a set analysis.

I have a chart (table) where i present customer, start date, end date, transaction amount.

the transaction amout needs to be calculated so that the date for the transaction amount is within the start date and end date interval.

start date and end date coming from one table and transactions coming from another table which i have joined in the script.

however, i don't get it to work.

in my chart i se a list of customers and one customer can have several start and end dates and when i try the set analysis it calculates transaction amout between teh lowest of these start dates and the highest of the end dates, not between the two on that one row.

this is the set analysis i've been using:

sum({$<transaction_date = {">=$(=min(start_date))<=$(=max(end_date))"}>} transaction_amount)

please help.

i've also tries interval match with no luck. but any suggestion will do at this moment!

thanks.

3 Replies
maxgro
MVP
MVP

you said

in my chart i se a list of customers and one customer can have several start and end dates and when i try the set analysis it calculates transaction amout between teh lowest of these start dates and the highest of the end dates, not between the two on that one row.


yes, set analysis doesn't depend on dimension dates on the row but on min and max dates of a set


maybe with a sum if

example sum(if(transaction_date>=start_date and transaction_date<=end_date, transaction_amount))

if possible, post a small example of your .qvw or some test data

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Just to add clarity and to reinforce the previous answer - the Set Analysis condition is calculated once per chart, before the chart is being calculated and rendered. It cannot be sensitive to the dimensions within the same chart.

One solution is to use sum(if()), however if this is too heavy (in case your dataset is large), you need to use data modeling and associate the range of the start-end dates with the transaction date.

We could possibly look at your specific example if you posted one.

Ask me about Qlik Sense Expert Class!
MarcoWedel

if one customer can have multiple start and end dates, then maybe the extended intervalmatch (with an additional dimension) might help.

regards

Marco