Announcements
MAINTENANCE ALERT: Dec. 12th starting 9 AM CET. Community will be read-only. GET DETAILS
cancel
Showing results for
Did you mean:
Contributor III

## Calculate sum before a specific date

hi,

suppose i have this table in database.

 Name Date amount x 1/15/2020 20 x 1/20/2020 27 x 1/23/2020 15 y 2/1/2020 45 y 2/5/2020 31

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)

• ### QlikView

2 Solutions

Accepted Solutions

Maye be :

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

Regards,
Taoufiq ZARRA

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

(you can mark up to 3 "solutions") 😉

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 "

(you can mark up to 3 "solutions") 😉
5 Replies

Maye be :

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

Regards,
Taoufiq ZARRA

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

(you can mark up to 3 "solutions") 😉
Contributor III
Author

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.

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

bellow with variable :

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

Regards,
Taoufiq ZARRA

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

(you can mark up to 3 "solutions") 😉
Contributor III
Author

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

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 "

(you can mark up to 3 "solutions") 😉
Community Browser