Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

sum values between dates in two tables

hello,

right now i´m developing a qlikview app and i´m trying to sum the values of a table between a range of dates, i have 2 dates that are the time that the user log in the system and the other one when he logout, all of them in one table, also, in other table are some fields that i want to sum, but these are inserted every minute, i tried to do something like these:

=sum({<kMS_FechaHora ={">=$(=FechaHoraIn) <=$(=FechaHoraOut)"}>} KMS_Recorridos)

i'm really new to the world of qlik and i can't figure how to solve this problem.

many thanks in advance for your help (sorry if my english it's bad ).

1 Solution

Accepted Solutions
Not applicable
Author

Much simpler would be to try the following

=sum(if(kMS_FechaHora >= FechaHoraIn and FechaHora <= FechaHoraOut,KMS_Recorridos))

Have Fun!!

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi,

you can create two variables:

vStart =GetFieldSelections(FechaHoraIn)

vEnd =GetFieldSelections(FechaHoraOut)

and then

sum({<kMS_FechaHora ={"<=$(vEnd)>=$(vStart)"}>} KMS_Recorridos)

  


KR

Elena

Not applicable
Author

Much simpler would be to try the following

=sum(if(kMS_FechaHora >= FechaHoraIn and FechaHora <= FechaHoraOut,KMS_Recorridos))

Have Fun!!

Anonymous
Not applicable
Author

thats just what i need!
thank you so much!