Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Tautvydas
Partner - Contributor
Partner - Contributor

Qlik Sense sum field till selected date

Hello everyone, I am finding some difficulties with the dates in Set Analysis expressions.

Maybe someone of you could help.

 

I have data which includes products and the date when they where moved to the specific location. I would like to have an option to choose specific date from list and see how many products where moved in that specific location until that date, i.e. min date is 2010-01-01, max date is 2018-01-01, if I choose 2016-05-24 I would like to see how many products were moved in that location from 2010-01-01 until 2016-05-24. I already made a list box for selecting dates, variable "vSelectedDate=GetFieldSelections(Date field)" which is taking the value from that list box and storing in variable, but now I am struggling with set analysis expression. I tried to write it like "sum({<InDate<={"<=$(vSelectedDate)"}>}Quantity)", but it doesn't work properly.

 

I hope someone of you could suggest something.

Thanks in advance.

Labels (1)
  • until

1 Solution

Accepted Solutions
OmarBenSalem

sum({<Year,Month,Week, Date={"<=$(=max(Date))"}>}Measure)

 

View solution in original post

6 Replies
OmarBenSalem

 
Tautvydas
Partner - Contributor
Partner - Contributor
Author

Thanks for your answer.

With this formula when I select date, table shows only the products which where moved in on that date.

I need all moves in before too.

dplr-rn
Partner - Master III
Partner - Master III

Try Changing your set analysis to below
$(=vSelectedDate)
Also check the output of the variable if it's correct. Try max(Date field) also in the variable
OmarBenSalem

sum({<Year,Month,Week, Date={"<=$(=max(Date))"}>}Measure)

 
Tautvydas
Partner - Contributor
Partner - Contributor
Author

Thank you for a solution.

It works now.

evansabres
Specialist
Specialist

Hello, this post was very helpful for a problem I am trying to solve. Is it possible to adapt this to be the max date minus seven days in the past, something like max(Date -7) ? What would the structure of this expression be?