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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Antonio1950
Contributor
Contributor

Sum field between two data

Hi,

in a KPI chart I want show the total sales between two dates.

I have two fiels imported from sql server (BillDate and Sales) and two variables (v_startdate and v_enddate).

I use this expression:

=Sum({<BillDate= {">='$(=date(v_startdate))' <='$(=date(v_enddate))'"}>} Sales)

but the value showed is always 0.

Can someone help me?
Thank you

 

 

Labels (5)
1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

Try this 

Sum({<BillDate={">=$(=date(v_startdate,'YYYY-MM-DD')) <=$(=date(v_enddate,'YYYY-MM-DD'))"}>} Sales)

 

Please check your date formats and adjust accordingly 

View solution in original post

2 Replies
Chanty4u
MVP
MVP

Try this 

Sum({<BillDate={">=$(=date(v_startdate,'YYYY-MM-DD')) <=$(=date(v_enddate,'YYYY-MM-DD'))"}>} Sales)

 

Please check your date formats and adjust accordingly 

Antonio1950
Contributor
Contributor
Author

Thank you very much . The tip works perfectly