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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ZimaBlue
Creator
Creator

Chart function with variable

Hello!

I have a variable called vtodayDate. It is: =date(today())

Based on this date, I am trying to calculate the amount in the Money column with a filter by the date specified in the variable. But I get "-" instead of the amount. The expression I'm using now:

Sum({<dateField<={$<vtodayDate>}>} distinct Money)

 

I've also tried various variations of {'$(vtodayDate)'} and also casting the variable to date via Date#, but this still returns "-" instead of the sum.

All the dates in my report are in the format DD.MM.YYYY and I don't understand what I'm doing wrong.

Thanks for any tips on how to fix this!

1 Solution

Accepted Solutions
ZimaBlue
Creator
Creator
Author

Sum({<dateField= {">=$(vDateFrom)<=$(vtodayDate)"}>} distinct [Money])

I tried it completely by accident and it turned out that this is how it should work. I hope this helps those who are experiencing the same problems, as it is not at all obvious. 

View solution in original post

1 Reply
ZimaBlue
Creator
Creator
Author

Sum({<dateField= {">=$(vDateFrom)<=$(vtodayDate)"}>} distinct [Money])

I tried it completely by accident and it turned out that this is how it should work. I hope this helps those who are experiencing the same problems, as it is not at all obvious.