Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show all dates by sales person

Hello,

I have a problem that I've been struggling to resolve - here's my issue:

In my script, I have set up holidays and used NetWorkDays(Floor(Date)) - Ceil(Date) and this gives me a total of 251 Working Days available when I select Year 2012. 

Sales Rep          Available Working Days

Salesperson1 -  214

Salesperson2 -  186

But when I put the salesperson in the table I get dates with activity per salesperson, which is good, but I also want to show a column for all 251 days so I can do some ratio calculations.

Sales Rep          Available Working Days     Total Days      % calculation

Salesperson1 -  214                                     251                    Total days * .6195 (set number)

Salesperson2 -  186                                     251

Is there a function I am missing or something I need to do in the script?

Thanks in advance

2 Replies
swuehl
MVP
MVP

I haven't fully understood how you calculate your working days using

NetWorkDays(Floor(Date)) - Ceil(Date)

since normally networkdays requires 2 arguments to define the date interval. I also haven't fully understood the way your sales reps limit the Available working days, so some more details about your data model might help here.

But to try to answer your question as I've understood, I see two possible solutions:

- create a variable to calculate your total days and reuse the variable in your table (saying table, I am assuming a chart object here, is this right?)

- try using the TOTAL qualifier, e.g. by applying an only() function around your total days calculation:

=only(TOTAL Networkdays(....) )

Hope this helps,

Stefan

Not applicable
Author

The client has a list of holidays that we had to remove so in the script I set up this line after embedding the holidays into the calendar.  If the rep has an activity within the calendar, then we get the count. 

Yes, the table I have is within a chart object.  I did try the =only(TOTAL(Networkdays.... ) and it comes back as an invalid expression in the script.  It comes back null as a formula.

Below is the sample of my code in the script:

NetWorkDays(Floor([Date]),Ceil([Date]),$(vHolidays)) as [Available Working Days],