Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
josephinetedesc
Creator III
Creator III

How do I make allowances for a Friday?

Hi

I have a Qlikview document whose selection is find records from the "Current and following day".

However, On a Friday, users want to see the next working day - ie Monday to be the following day.

How would I code for this?

something along the lines of if ISO Day > 4, then following day = ISO Day 1?

Currently the rows come directly from SQL - so would i need to do a Resident load?

I can use this as RealFollDay but how do I show curernt day and RealFollDay??

if(WeekDay(Date([Appt Date])) = 'Fri', 'Mon', (WeekDay(Date([Appt Date]) + 1 ))) as RealFollDay,

Jo

4 Replies
balabhaskarqlik

Set vCal_FD = 0; // First Day of the week (0=Mon, 1=Tue, ... , 6=Sun)

WeekStart( Date, 0, $(vCal_FD) ) as WeekStart

Dual( WeekDay( Date ), Mod( WeekDay( Date - $(vCal_FD) ), 7 ) +1 ) as WeekDay

josephinetedesc
Creator III
Creator III
Author

so my load script is

Directory;

LOAD

     [Appt Date],

     weekDay([Appt Date]) as Weekday,

   // Day(Date([Appt Date])) as ISOWeekDay,

    if(WeekDay(Date([Appt Date])) = 'Fri', 'Mon', (WeekDay(Date([Appt Date]) + 1 ))) as RealFollDay,

    if(num(WeekDay(Today())) = 5, (WeekDay(Date([Appt Date]) + 1 )) ) as RealFollDay2,

     Status,

     [Resources Allocated]

FROM

fromSQL.qvd

(qvd);

How do I get the my table to show today's values and the real following day ... _ I suppose set analysis?

Jo

josephinetedesc
Creator III
Creator III
Author

Change date to last friday?

Looking at the above (Thank you  AnnaLisa)

I did the following:

if(num(WeekDay(Today())) = 1,  num(WeekDay(Today())) +2,   

    if(num(WeekDay(Today())) = 2,  num(WeekDay(Today())) +3    ,   

    if(num(WeekDay(Today())) = 3,  num(WeekDay(Today())) +4 ,   

    if(num(WeekDay(Today())) = 4,  num(WeekDay(Today())) +5    ,   

    if(num(WeekDay(Today())) = 5,  num(WeekDay(Today())) +3   

    )))))as DaysOfInt,

then I displayed one table as today() and then another table as DaysOfInt.

The SQL only loads 4 days of data so this works.

Thank you

Jo

josephinetedesc
Creator III
Creator III
Author

no - still having problems - i want to display 2 days worth of data - todays data PLUS 1 or todays data + 3 (depending on whether it is a Friday!

if(WeekDay([Appt Date] = 4),

([Appt Date] = today() or ([Appt Date] = (today() + 3))),

([Appt Date] = today() or ([Appt Date] = (today() + 1)))

)