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

Days count from today

=

'Number of Days selected '&num(NetWorkDays(min(Date),max(Date)))

Hi Guys

I have a text box to cout the number of working days selected, however I have data loaded in to forcast . What the above formula is doing is counting all dates, it works when specific dates are selected, but when nothing is , it is counting all available dates including dates in the future.

Is it possible to change it so it counts the selected dates , and defaults at number of days in the past until today -1

Please help !!!!
Thanks



Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

OMG it works

=

'Number of Days selected '&num(if(max(Date)>today(-1),NetWorkDays(min(Date),today(-1)),NetWorkDays(min(Date),max(Date))))

Thanks





View solution in original post

3 Replies
matt_crowther
Specialist
Specialist

Look to place an 'IF' in there based around '<today()'. to limit the dates the expression is looking at.

All the best,

Matt - Visual Analytics Ltd

Not applicable
Author

OMG it works

=

'Number of Days selected '&num(if(max(Date)>today(-1),NetWorkDays(min(Date),today(-1)),NetWorkDays(min(Date),max(Date))))

Thanks





Not applicable
Author

OMG it works

=

'Number of Days selected '&num(if(max(Date)>today(-1),NetWorkDays(min(Date),today(-1)),NetWorkDays(min(Date),max(Date))))

Thanks