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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping

hi all,

PFA

i have holiday Data of calender year state wise, like

Data:

LOAD State,

     HoliDay,

     Date(Dates,'DD-MM-YYYY') as Dates

FROM

then i Created  Dates of year  by following way

Date_genration:

LOAD  Date(Date#(20131231,'YYYYMMDD')+RecNo(),'DD-MM-YYYY') AS Dates

AutoGenerate Ceil (YearEnd(Today())) -YearStart(Today());

then i joined  these two tables

now i want check when their is holiday then which type it is like

first i want to check whether that is holiday or not by comparing with data stored above Data Table if yes

then i want to check its day type like weekday or weekend

suppose that i have holiday on 1st Jan  suppose it Monday  then its should have flag weekday

suppose that i have holiday on 1st Jan  suppose it Sunday  then its should have flag weekend


this way we will get three field in flag Holiday,Weekday,WeekEnd


i have tried but i can't succeed


thanks in Advance

20 Replies
preminqlik
Specialist II
Specialist II

hi PFA

Date_genration:

LOAD

Date(Date#(20131231,'YYYYMMDD')+RecNo(),'DD-MM-YYYY') AS Dates

AutoGenerate Ceil (YearEnd(Today())) -YearStart(Today());

LEFT Join

LOAD DISTINCT

State,

  Date(Dates,'DD-MM-YYYY') as Dates,

  1 as Holiday_Flag,

  if(WeekDay(Dates)<6, 1, Null()) as Weekday_Flag,

  if(WeekDay(Dates)>=6, 1, Null()) as Weekend_Flag

FROM fest.xlsx

(ooxml, embedded labels, table is Sheet2);

Load *,

text(date(Dates,'WWW')) as Dayname,

if((text(date(Dates,'WWW'))='Sat' or text(date(Dates,'WWW'))='Sun') and len(Holiday_Flag)>0,'Weekend',if(

(text(date(Dates,'WWW'))<>'Sat' or text(date(Dates,'WWW'))<>'Sun') and len(Holiday_Flag)>0,'Weekday' )) as HOLIDAY_STATUS

resident Date_genration;

drop table Date_genration;