Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Calculate sum before a specific date

hi,

suppose i have this table in database.

NameDateamount
x1/15/202020
x1/20/202027
x1/23/202015
y2/1/202045
y2/5/202031

 

i want calculate sum(amount) of records with name 'x' and before date for example 01/22/2020 in expression in a chart.

for example the answer become 20+27=47

show 47.

Labels (3)
2 Solutions

Accepted Solutions
Highlighted
Specialist III
Specialist III

Re: Calculate sum before a specific date

Maye be :

=sum({$<Name={'x'},Date={"<=$(=Date#('1/22/2020','M/DD/YYYY'))"}>} amount)

 

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

View solution in original post

Highlighted
Specialist III
Specialist III

Re: Calculate sum before a specific date

no but

=Date#('2020/01/01','YYYY/MM/DD')

Date#

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

View solution in original post

5 Replies
Highlighted
Specialist III
Specialist III

Re: Calculate sum before a specific date

Maye be :

=sum({$<Name={'x'},Date={"<=$(=Date#('1/22/2020','M/DD/YYYY'))"}>} amount)

 

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

View solution in original post

Highlighted
Contributor III
Contributor III

Re: Calculate sum before a specific date

thank you for reply.

I put specific date in a variable. 

suppose Date and specific date is not in format 'MM/DD/YYYY'.

how can i calculate both in this format.

Highlighted
Specialist III
Specialist III

Re: Calculate sum before a specific date

@mrbqlik2009 

you can change Date Format in 'MM/DD/YYYY' to another 

bellow with variable :

Taoufiq_ZARRA_0-1590161111546.png

 

=sum({$<Name={'x'},Date={"<=$(=vDate)"}>} amount)

 

Taoufiq_ZARRA_1-1590161160343.png

 

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "
Highlighted
Contributor III
Contributor III

Re: Calculate sum before a specific date

can put Date#('01/01/2020','YYYY/MM/DD') in expression?

Highlighted
Specialist III
Specialist III

Re: Calculate sum before a specific date

no but

=Date#('2020/01/01','YYYY/MM/DD')

Date#

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

View solution in original post