Discussion Board for collaboration on QlikView Scripting.
i have a table of job positions contating information of each time it got vacant and then filled , having both start date and end date.
I wnat to calculate the time period of position from vacant to being filled each time or average time of any position to be filled
Go to Solution.
Try ur Method .little modify
Load positionId, ([enddate] +1) - [startdate] As NoDays
Use Peek or Previous Function in Script
can you apply it on my requirement plz
Load * ,
if(Status='Filled',StartDate - Peek(EndDate) ) As No Days
use this Method.i thing Useful for U.
Permual method is right but u have to add the order by function with
Position and Startdate so that the peek will work fine so try this
PositionId ,StartDate, EndDate, Status ,
if(PositionId = peek(PositionId) and peek(Status) = '0pen', date(EndDate)- date(peek(StartDate)) ) as Diffdate
order by PositionId, StartDate ;
HiI have tried both suggestions but the calculated column is empty,i am calculating the duration by this formula
Load positionId, [enddate] - [startdate] As NoDays
is it a ri ght approach??
because enddate of open status is just before the date it got filled