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: 
Not applicable

Sum from beggining of time to select date

Hello

I have this problem, I am trying to get the sum from the beggining of time until the date that is select in filters, in order to obtein the inventory stock by date (the range of date selected) I mean:

Fecha Movimiento // sum({< BODEGA={'Bodega PT local'},[Fecha Movimiento]={'<=$(=max(vFecha))'}, Año=, Mes=, Dia= >} Cantidad1) // /1000 //sum({<[Fecha Movimiento] = {'<=$(=date(vFechaCorte))'}>}Cantidad1) sum({< BODEGA={'Bodega PT local'},[Fecha Movimiento]={'>=28/01/2001 <=22/06/2014'} >} Cantidad1)MakeDate(Año, Mes, Dia)=date(36919)
Total 470122.63 28/01/2001
02/06/20140.0002/06/201428/01/2001
03/06/20140.0003/06/201428/01/2001
04/06/20140.0004/06/201428/01/2001
05/06/20140.0005/06/201428/01/2001
06/06/20140.0006/06/201428/01/2001
07/06/20140.0007/06/201428/01/2001
08/06/20140.0008/06/201428/01/2001
09/06/20140.0009/06/201428/01/2001
10/06/20140.0010/06/201428/01/2001
11/06/20140.0011/06/201428/01/2001
12/06/20140.0012/06/201428/01/2001
13/06/20140.0013/06/201428/01/2001
14/06/20140.0014/06/201428/01/2001
15/06/20140.0015/06/201428/01/2001
16/06/20140.0016/06/201428/01/2001
17/06/20140.0017/06/201428/01/2001
18/06/2014470122.6318/06/201428/01/2001
19/06/20140.0019/06/201428/01/2001
20/06/20140.0020/06/201428/01/2001
21/06/20140.0021/06/201428/01/2001
22/06/20140.0022/06/201428/01/2001

as you can the script that I tried is there, I want it sum from 0/0/0000 to date, but is only sum from selected dates, which is a mistake.

best Regards

1 Reply
vgutkovsky
Master II
Master II

The key is to also ignore your selectable date filters. I typically create a lowest-level date field (i.e. Date or %DATE_KEY) that is not displayed to users for selection. Then use this field to control your set analysis. Might look something like this:

Variable Definitions

vLatestDate

=max(Date)

vDateIgnore

Month,Year,Day,Date

Expression

sum({<$(vDateIgnore),%DATE_KEY={"<=$(vLatestDate)"}>} Sales)

Regards,

Vlad