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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with network days

Hello!

I need not consider Saturdays and Sundays in my qv document. I have to calculate the data of yesterday, but when today is Monday i want to calculate data of Friday.

Thank you for your help!!!

14 Replies
simondachstr
Specialist III
Specialist III

Try using FirstWorkDate(Today(),2) maybe..

Not applicable
Author

I have an object text:

=num(count({$<Day={$(=Max(Day)-1)},[name]={'BOOK'},[id]={1},[ip]={7}>}distinct id_2)

How do I add your function ?


Thank you @Martin Mahler

simondachstr
Specialist III
Specialist III

=num(count({$<Day={'$(=FirstWorkDate(Today(),2))'},[name]={'BOOK'},[id]={1},[ip]={7}>}distinct id_2)

Not applicable
Author

Thanks but not work.

I want the data every day of "yesterday", when is tuesday->data monday, when is wednesday-> data tuesday and when is monday->data friday

simondachstr
Specialist III
Specialist III

What is the format of your Day field?

Not applicable
Author

Script Editor sql:

datepart(dd,table_pp.date_reg) AS 'Day',

simondachstr
Specialist III
Specialist III

Can you be more specific - what does a typical record look like? 01/10/2014? 28 Jan?

Not applicable
Author

Of course.

Example:

07/10/2014 10:04:53

DD/MM/YYYY h:mm:ss

simondachstr
Specialist III
Specialist III

You could use some complex set analysis here, but I stronlgy recommend to you to load an additional date field in the script

Date(Date#(datepart(dd,table_pp.date_reg),'DD/MM/YYYY HH:MM:SS'),'DD/MM/YYYY') AS Date

to get the following format instead: 07/10/2014

Then, use this field in your set analysis:

=num(count({$<Date={'$(=FirstWorkDate(Today(),2))'},[name]={'BOOK'},[id]={1},[ip]={7}>}distinct id_2)