Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
fdelacal
Specialist
Specialist

table in script

i have a table like this

dateroomstartendtotal
05/04/2012303
06/04/2012003
07/04/2012030
09/04/201211011
10/04/20120011
11/04/20121111
12/04/20120011
13/04/20120011
14/04/20120011
15/04/2012092
16/04/2012323
17/04/2012214

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.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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

];


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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

];


talk is cheap, supply exceeds demand