Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

dreamer78692
Contributor

Load only weekdays

Hi,

I have the following script

LOAD Date, Name, Value

WHERE Weekday(Date) = true ;

I only want the dates that occurs on weekdays.

Any assistance is appreciated.

Kind Regards

Dreamer78692

Tags (2)
1 Solution

Accepted Solutions
sbobbyraj
Contributor III

Re: Load only weekdays

Hi,

Try:

LOAD

     Date, Name, Value

WHERE

     Weekday(Date)<>'sat.' AND Weekday(Date)<>'sun.'  ;

(check before that your DayNames is 'sat.' for saturday and 'sun.' for sunday)

6 Replies

Re: Load only weekdays

Try this:

LOAD Date, Name, Value

WHERE Weekday(Date) <5 ;


talk is cheap, supply exceeds demand
dreamer78692
Contributor

Re: Load only weekdays

Hi,

I tried that but for some reason Monday is also not getting loaded.

Kind Regards

Dreamer78692

Re: Load only weekdays

Hi

LOAD Date, Name, Value

WHERE Wildmatch(Weekday(Date),'mon','tue','wed','thu','fri');

Hope it helps

sbobbyraj
Contributor III

Re: Load only weekdays

Hi,

Try:

LOAD

     Date, Name, Value

WHERE

     Weekday(Date)<>'sat.' AND Weekday(Date)<>'sun.'  ;

(check before that your DayNames is 'sat.' for saturday and 'sun.' for sunday)

MVP
MVP

Re: Load only weekdays

Hi,

Try like this

LOAD

     DateFieldName,

    *

FROM DataSource

WHERE WeekDay(DateFieldName) <> 'Sat' OR WeekDay(DateFieldName) = 'Sun';

Hope this helps you.

Regards,

Jagan.

vivientexier
Contributor II

Re: Load only weekdays

A clean way to do this is to use NetWorkDaysDate() function.

LOAD

    Date

  , Name

  , Value

WHERE NetWorkDaysDate(Date, Date) = 1

;

Community Browser