Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum between to values in a period where one date is already defined and the other selected

Hi everyone,

I'm pretty new at QlikView and I need to create a sum between two dates, the initial date is already defined and the final date will be selected by user.

For example: Sum({$<Date={">'2010-01-01 00:00:00'<$(SelectedDate) "}>} ValueToSum)

                                                

I've been searching for this at this forum, but i can't find it.

Help?

1 Solution

Accepted Solutions
avinashelite

sum({<Calender_Date={"Date={">Timestamp#('2010-01-01 00:00:00','YYYY/MM/DD hh:mm:ss[.fff] TT')<$(SelectedDate) ""}>}ValueToSum)


NOTE: make sure that your date columns have the same date formats

View solution in original post

7 Replies
Not applicable
Author

What is the problem with your expression? It looks good to me, assuming 'SelectedDate' is a variable which gets selected date value.

Not applicable
Author

It doesen't work =(

Anonymous
Not applicable
Author

try this

= Sum({$<Date={">Timestamp#('2010-01-01 00:00:00','YYYY/MM/DD hh:mm:ss[.fff] TT')<$(SelectedDate) "}>} ValueToSum)

sasiparupudi1
Master III
Master III

Please try

Sum({$<Date={">'2010-01-01 00:00:00'<'$(SelectedDate)' "}>} ValueToSum)

avinashelite

sum({<Calender_Date={"Date={">Timestamp#('2010-01-01 00:00:00','YYYY/MM/DD hh:mm:ss[.fff] TT')<$(SelectedDate) ""}>}ValueToSum)


NOTE: make sure that your date columns have the same date formats

Kushal_Chawda

Try,

sum({<Date ={">=$(=Timestamp#('2010-01-01 00:00:00','YYYY-MM-DD'))<=$(=SelectedDate)"}>}ValueToSum)

Not applicable
Author

The field had the same format =(