Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
G_G
Partner - Contributor
Partner - Contributor

Sum value for a specific date range from date dimension

Hello All 

I have the following scenario.

Table1

G_G_2-1602250093596.png

 

Table 2

G_G_1-1602249800174.png

 

The above two tables are linked with DATE_KEY in Qlik data model 

when the user selects "MONTH_NAME" as 2016-03 in the filter , then i have to sum "Amount" for the range of START_DATE_QTD_KEY to END_DATE_QTD_KEY.  i.e from 1 to 3 date key from the Table 2 , sum of amount should be 60

Can any one help me in this ?

 

Regards

G

 

Labels (2)
1 Reply
Kushal_Chawda

@G_G  try below.

Create two variables on frond end like below

vSTART_DATE_QTD_KEY = max(START_DATE_QTD_KEY)

vEND_DATE_QTD_KEY =max(END_DATE_QTD_KEY)

 

Then try below expression

=Sum({<MONTH_NAME,DATE_KEY={">=$(vSTART_DATE_QTD_KEY)<=$(vEND_DATE_QTD_KEY)"}>}Amount)