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

rangesum movil sum

Hello

I have a table with timestamps and value. for example

 

stampValue
6:05:0039,41
6:12:3527,93
6:20:1025,13
6:27:4521,2
6:35:2119,94
6:39:4329,54
6:44:06107,85
6:48:2824,37
6:52:5140,8
6:57:14100,55
7:01:3658,09
7:05:0389,2
7:08:3051,45
7:11:5781,24
7:15:2458,11
7:18:5166,5
7:22:1876,02
7:25:4497,27
7:29:11125,55
7:32:3850,12
7:35:4870,81
7:38:5899,11

i need to create a new column, each value in the new colum must be the sum of the above values of the field Value but only of the revords where the stamp time is lower than 60 minutes of the first record.

For excample in the above table, the new value of the record 1 will be the sum of the above records  records where the stamp is lower than 6:05:00 + 60 minutes --> 7:05:00, and so it must sum the values from 39,41 (stamp = 39,41)  to 58,09 (stamp 7:01:36).

In the secord rows the same, the new value field must sum the values from 27,93 (stamp 6:12:35) to the value 81,24(stamp 7:11:57)

and so on....

 

stampValueNewSum Value
6:05:0039,41494,81
6:12:3527,93677,29
6:20:1025,13773,97
6:27:4521,2….
6:35:2119,94
6:39:4329,54
6:44:06107,85
6:48:2824,37
6:52:5140,8
6:57:14100,55
7:01:3658,09
7:05:0389,2
7:08:3051,45
7:11:5781,24
7:15:2458,11
7:18:5166,5
7:22:1876,02
7:25:4497,27
7:29:11125,55
7:32:3850,12
7:35:4870,81
7:38:5899,11
7:42:08140,6
7:45:17164,24
7:48:2759,69
7:51:3780,4

is there a way to do this in the scrip or in a graph expresion using rangesum or other function

thanks in advance for your help

regards

2 Replies
dcd123456
Creator
Creator
Author

Anyone know if there is a way to use rangesum with above function but filtering the records that above function must take, for example filtering by the value of other field.

Thanks in advance

regards

jerryyang756
Creator
Creator

Dimension : stamp

Expression:

     1) Sum(Value)

     2) If(stamp < '7:05:00', Rangesum(Above(Sum(Value),0,RowNo(TOTAL))))

sdf.PNG