Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

madnanansari
New Contributor III

Number of working days during a month

I am working on Retail Sales data.

In some cities the stores works 7 days whereas in some they work 6 days a week and 5 days a week as well. My requirement is to find out the number of working days for a specific store during a month.

I am using standard master calendar.

The below are the table formats:

City:

-CityID

-City

Store:

-StoreID

-CityID

City Operational Days:

CityID

Operational Day. (Sat, Sun, Mon etc)

4 Replies

Re: Number of working days during a month

Maybe something like this

=count({<

     Date= {"=match(weekday(Date),'Tue','Thu','Sat')"} ,

     Month={'Jan'}

          >} Date)

madnanansari
New Contributor III

Re: Number of working days during a month

There is a table where the working days are listed as below:

City Work Days:

City   :  Day

NewYork: Mon

NewYork: Tue

NewYork: Wed

NewYork: Thu

NewYork: Fri

LosAngeles: Mon

LosAngeles: Tue

LosAngeles: Wed

LosAngeles: Thu

LosAngeles: Fri

LosAngeles: Sat

The formula should look into this table.

isingh30
Contributor III

Re: Number of working days during a month

Try Network Days function -

networkdays (start_date, end_date [, holiday])

Example -

   You need to specify the holidays in networkday().

   For example you want networkdays between 2006-12-18 and 2006-12-31.

   If you just give this without the specific holidays you will get 10 as output.

   But say you have holiday on 2006-12-25 and 2006-12-26

   Then specify like this

   networkdays ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26')

 

   and you will get answer as 8.

Thanks.

Re: Number of working days during a month

You'll probably need something like this then :

=count({<

Date= {"=match ( weekday(Date) , $(=concat( chr(39) & Day & chr(39), ',')) )"}

    >} Date)

I expect you'll need to adjust it to fit in with your precise data model.

If you have problems with it then post a sample qvf.

Community Browser