Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME 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
Luminary Alumni
Luminary Alumni

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
Luminary Alumni
Luminary Alumni

=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
Luminary Alumni
Luminary Alumni

What is the format of your Day field?

Not applicable
Author

Script Editor sql:

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

simondachstr
Luminary Alumni
Luminary Alumni

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
Luminary Alumni
Luminary Alumni

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)