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

Working with Dates and Master Calendar

I need to sum the rents of different apartments over time where the tenant is changing and the rent can change as well over time. 

I have two dates in one table, a startdate, an enddate and the rent of the apartment. Furthermore  I have a master calendar with the column "date". Now I would like to have a graph with "date" on the x-axis and the "sum of the rents" on the Y-axis. 

 

If I use the line chart with the dimension "date" out of a master calendar and as a measure the following expression =sum(if(date > [StartDate] and date < [EndDate] , Rent))

it works. However, the performance is really slow. I would like to solve the problem with a set analysis. 

I tried something like this: 

=sum( {<date = {'>=$(StartDate)'}, date = {'<$(EndDate)'} >} Rent)

But this does not work. Do you know how to do it?

Labels (1)
5 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

try this expression

=sum( {<date = {">=$(StartDate)<$(EndDate)"} >} Rent)

janruffner
Contributor
Contributor
Author

Thank you. 

But I get a value which does not change over time. 

marcus_sommer

You need to resolve your start + end date per IntervalMatch to a real date which is then linked to your master-calendar.

- Marcus

janruffner
Contributor
Contributor
Author

Could you explain how you would do it?

marcus_sommer

Just use a few dummy-data and apply the intervalmatch-logic like described in the link and to comprehend the logic and then play a bit with the results.

- Marcus