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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Workingdays

Hi,

The following expression gives me total number of days. I just need to get working days. How should I change the following expression to get workingdays:  

 

sum

({<WorkflowElapseDays

={'Customer'

}>}diff

)/count

(distinct

Application_Id

)

Labels (1)
6 Replies
rustyfishbones
Master II
Master II

use NETWORKDAYS() Function

Not applicable
Author

I tried the following but didnot work:

 

networkdays(sum ({<WorkflowElapseDays={'Customer'}>}diff))/count(distinct Application_Id)

fkeuroglian
Partner - Master
Partner - Master

Hi!

You can use the function NETWORKDAYS , returns the works days between the two dates you pass in the function

networkdays (fecha_inicio, fecha_fin {, vacaciones})

example:

NetWorkDays(MonthStart( today()),Monthend( today()))

good luck!

Fernando

rustyfishbones
Master II
Master II

to use the Networkdays you need a start date and an end date something like

NETWORKDAYS('01/01/2012', TODAY())
Not applicable
Author


I have the following code how will use networkdays in it for diff. At the moment diff gives me total numbe of days

Wrkflow:
LOAD   Process_Code ,
Application_id   as   Application_Id ,
Workitem_Id ,
Activity_Code ,
Timestamp ( Txn_Date ) as   Txn_Date ,
State_Code ,
Assigned_User_Id ,
Assigned_Dept_Id ,
Actioned_User_Id ,
applymap ( 'Trays' , Activity_Code , null ()) as   Tray ,
applymap ( 'Trays' , Activity_Code , null ())& State_Code   as   Link ,
if ( State_Code = 'CMP' , timestamp ( Txn_Date ), null ()) as   [CMP_Date]

FROM

( txt , codepage   is   1252 , embedded   labels , delimiter   is   '\t' , msq ) ;
Wrkflow2:
Load   * , 1
Resident   Wrkflow
Order   by   Application_Id , CMP_Date , Tray , State_Code;
DROP   Table   Wrkflow;
Wrkflow3:
Load   * ,
CMP_Date - if ( State_Code = 'CMP'  ,( Previous ( CMP_Date )), '' ) as   diff ,
if ( State_Code = 'CMP'  ,( Previous ( CMP_Date )), '' ) as   pre
Resident   Wrkflow2;
DROP   Table   Wrkflow2;

Not applicable
Author

Fernando where should i add networkdays in the following code:

Wrkflow:
LOAD   Process_Code ,
Application_id   as   Application_Id ,
Workitem_Id ,
Activity_Code ,
Timestamp ( Txn_Date ) as   Txn_Date ,
State_Code ,
Assigned_User_Id ,
Assigned_Dept_Id ,
Actioned_User_Id ,
applymap ( 'Trays' , Activity_Code , null ()) as   Tray ,
applymap ( 'Trays' , Activity_Code , null ())& State_Code   as   Link ,
if ( State_Code = 'CMP' , timestamp ( Txn_Date ), null ()) as   [CMP_Date]

FROM

( txt , codepage   is   1252 , embedded   labels , delimiter   is   '\t' , msq ) ;
Wrkflow2:
Load   * , 1
Resident   Wrkflow
Order   by   Application_Id , CMP_Date , Tray , State_Code;
DROP   Table   Wrkflow;
Wrkflow3:
Load   * ,
CMP_Date - if ( State_Code = 'CMP'  ,( Previous ( CMP_Date )), '' ) as   diff ,
if ( State_Code = 'CMP'  ,( Previous ( CMP_Date )), '' ) as   pre
Resident   Wrkflow2;
DROP   Table   Wrkflow2;