Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
antonybi
Creator
Creator

count days from range!!!

Hi Everyone,

Below are the working days from Monday to Friday and we are not considering Saturday and Sunday and other holidays

Capture1.JPG

From here I want to calculate no of working days per month.

In March, total working days

1-3------>3

6-10---->5

13-17--->5

20-24--->5

27-31--->5

3+5+5+5+5=23 days

In KPI, I want to show no of working days for remaining months as well.

How do we accomplish this requirement.

Kindly suggest.

7 Replies
PrashantSangle

try with straight table

dimension -> month

expression

->sum(subfield(Schedule week_new,'-',2)-subfield(Schedule week_new,'-',1))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
tresesco
MVP
MVP

Or may be just (without sum) this?

subfield(Schedule week_new,'-',2)-subfield(Schedule week_new,'-',1) +1

PrashantSangle

Thanks tresesco for correction but I am not sure how to write logic for last value in Schedule week_new list box.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
andrei_delta
Partner - Creator III
Partner - Creator III

hello,

why don't you calculate the no of Working Days in the script where you calculate the Schedule week_new field and in the UI you just use a simple sum aggregated by Month?


Regards,

Andrei

antonybi
Creator
Creator
Author

    Thanks for quick response!!!

     

Capture2.JPG

As above snapshot, it is clearly showing for Jan month 30-3(Jan30-Feb3)

Here, I want to split the dates Jan30 and Jan31 into Jan Month

and consider remaining days(Feb1, Feb2 and Feb3) into Feb Month.

is this possible ??

Kushal_Chawda

another approach could be, create field in script

LOAD *,

           fabs(Evaluate(Field))+1 as WorkingDays

FROM table;

Now you can write the expression

sum(WorkingDays)


Note:Field = schedule week_new

omkarvamsi
Creator
Creator

you can use network days function and also we can get count of working days after excluding holidays too