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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
RazRep
Contributor
Contributor

Variable date in sum

Hi,

I am trying to get  the sum of amounts received on a certain day. Unfortunatly it seems like i'm not able to achive that.

I am already using the next formula to get the amount between two dates:

Sum ({<grtb_rek = {1100}, datum = {">=$(vDatumStart)<=$(vDatumEind)"}, debiteur -= {000000}, Dagboektype = {"Bank"}>} bedrag)

This works without problems, but when I change it to:

Sum ({<grtb_rek = {1100}, datum = {"=$(vDatumStart)"}, debiteur -= {000000}, Dagboektype = {"Bank"}>} bedrag)

it will return the amount of all dates which are loaded (like you have not set a date boundary).  I have also tried using datum = {"8-3-2021"} and then it works fine. What am I doing wrong?

1 Solution

Accepted Solutions
eddie_wagt
Partner - Creator III
Partner - Creator III

Hello RazRep,

To solve it, the following is important to check.

1. What is your expression in variable vDatumStart?

2. What is the date format (dd-MM-yyyy) of the field datum and the date format in the variable

3. Syntax of your set analysis is wrong, but it depends on 1 and 2. This should be correct

Sum ({<grtb_rek = {1100}, datum = {"$(vDatumStart)"}, debiteur -= {000000}, Dagboektype = {"Bank"}>} bedrag)

Regards 

 

Eddie

View solution in original post

2 Replies
eddie_wagt
Partner - Creator III
Partner - Creator III

Hello RazRep,

To solve it, the following is important to check.

1. What is your expression in variable vDatumStart?

2. What is the date format (dd-MM-yyyy) of the field datum and the date format in the variable

3. Syntax of your set analysis is wrong, but it depends on 1 and 2. This should be correct

Sum ({<grtb_rek = {1100}, datum = {"$(vDatumStart)"}, debiteur -= {000000}, Dagboektype = {"Bank"}>} bedrag)

Regards 

 

Eddie

RazRep
Contributor
Contributor
Author

Hi Eddie,

The problem was indeed the date format. Now that I have changed that it works perfectly. 

A big thanks to you!