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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
rpavan17
Creator
Creator

Hours excluding weekends(Sat,Sun)48 Hrs

Hi,

I am trying to get Network hours between two timestamps.

This formula works in excel.

NETWORKDAYS(min({<Flag_First_Flow={'Yes'}>}Time_stamp_His),min({<Flag_Invoice_Approved={'Yes'}>}Time_stamp_His))-1-

MOD(min({<Flag_First_Flow={'Yes'}>}Time_stamp_His),1)+MOD(min({<Flag_Invoice_Approved={'Yes'}>}Time_stamp_His),1)

also, the below works in qliksense

=NETWORKDAYS(min(INVOICE_DATE),min(SCAN_DATE))-1-MOD(min(INVOICE_DATE),1)+MOD(min(SCAN_DATE),1)

But, when i use "Time_stamp_His" only it wont work.

MOD(min(Time_stamp_His),1) will not give any result, just blank. I have checked the format both INVOICE_DATE,SCAN_DATE and Time_stamp_His format is same.


Kindly help.


1 Solution

Accepted Solutions
DavidŠtorek
Creator III
Creator III

Hi,

you are absolutely right with MOD function. The reason is that MOD() requires INTEGERS as imputs, which surely timestamp is not.

Capture.PNG

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Make sure Time_stamp_His contains a real timestamp value and not just text values that only look like timestamps. If necessary use the TimeStamp# function to turn text values into timestamp values.


talk is cheap, supply exceeds demand
rpavan17
Creator
Creator
Author

It gives the result for Timestamp for below formula.

NETWORKDAYS(min({<Flag_First_Flow={'Yes'}>}Time_stamp_His),min({<Flag_Invoice_Approved={'Yes'}>}Time_stamp_His)) . Network days result is correct


When i add MOD(min({<Flag_First_Flow={'Yes'}>}Time_stamp_His),1)+MOD(min({<Flag_Invoice_Approved={'Yes'}>}Time_stamp_His),1) It will not give any result.


For me, it looks like there is a issue with MOD and Time_stamp_His

rpavan17
Creator
Creator
Author

The below works..

=NETWORKDAYS(min({<Flag_First_Flow={'Yes'}>}Time_stamp_His),min({<Flag_Invoice_Approved={'Yes'}>}Time_stamp_His))

-1-frac(min({<Flag_First_Flow={'Yes'}>}Time_stamp_His))+frac(min({<Flag_Invoice_Approved={'Yes'}>}Time_stamp_His))

DavidŠtorek
Creator III
Creator III

Hi,

you are absolutely right with MOD function. The reason is that MOD() requires INTEGERS as imputs, which surely timestamp is not.

Capture.PNG