Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have a table like this
dateroom | start | end | total |
05/04/2012 | 3 | 0 | 3 |
06/04/2012 | 0 | 0 | 3 |
07/04/2012 | 0 | 3 | 0 |
09/04/2012 | 11 | 0 | 11 |
10/04/2012 | 0 | 0 | 11 |
11/04/2012 | 1 | 1 | 11 |
12/04/2012 | 0 | 0 | 11 |
13/04/2012 | 0 | 0 | 11 |
14/04/2012 | 0 | 0 | 11 |
15/04/2012 | 0 | 9 | 2 |
16/04/2012 | 3 | 2 | 3 |
17/04/2012 | 2 | 1 | 4 |
date room i neen to know how many room are occuped
start is day that enter the people to the room end when they go.
i need to know total.
thanks.
T1:
LOAD *, rangesum(start,-end,peek(DateTotal)) as DateTotal
INLINE [
dateroom, start, end
05/04/2012, 3, 0
06/04/2012, 0, 0
07/04/2012, 0, 3
09/04/2012, 11, 0
10/04/2012, 0, 0
11/04/2012, 1, 1
12/04/2012, 0, 0
13/04/2012, 0, 0
14/04/2012, 0, 0
15/04/2012, 0, 9
16/04/2012, 3, 2
17/04/2012, 2, 1
];
T1:
LOAD *, rangesum(start,-end,peek(DateTotal)) as DateTotal
INLINE [
dateroom, start, end
05/04/2012, 3, 0
06/04/2012, 0, 0
07/04/2012, 0, 3
09/04/2012, 11, 0
10/04/2012, 0, 0
11/04/2012, 1, 1
12/04/2012, 0, 0
13/04/2012, 0, 0
14/04/2012, 0, 0
15/04/2012, 0, 9
16/04/2012, 3, 2
17/04/2012, 2, 1
];