Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Flag linking problem

hi all,

PFA

i have a holiday list

through which i have calculated  Net working days and all required things

then i i have created a calender  for this year  and using them in creating flag

but am getting one problem when taking holiday using apply map am not getting it correctly for For my Flag festival

when i select a State from dimension And then when i select Festival from Flag then it show very few dates or Count of Date

am think that this is apply map problem

how to solve it and how to create three flags? for my datei

flags = festival,

           weekday,

          weekend

Thanks in advance

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

please check this one...

View solution in original post

15 Replies
maneshkhottcpl
Partner - Creator III
Partner - Creator III

Hi

You can try attached file

Apply map is not necessary

Regards

Manesh

MK_QSL
MVP
MVP

I haven't tried but you can try using below script..

Temp:

Mapping LOAD

  State,

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

FROM

fest.xlsx

(ooxml, embedded labels, table is Sheet2);

//======================================================

Data:

LOAD State,

     HoliDay,

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

FROM

fest.xlsx

(ooxml, embedded labels, table is Sheet2);

//======================================================

Join(Data)

Date_genration:

LOAD

  Date(YearStart(Today()) + RecNo() - 1) as Dates

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

NoConcatenate

FinalTable:

Load

  State,

  Dates,

IF(IsNull(HoliDay) and WeekDay(Dates) = 'Sat', 'WeekEnd',

  IF(IsNull(HoliDay) and WeekDay(Dates) = 'Sun', 'WeekEnd',

  IF(Not IsNull(HoliDay), 'Festival',

  'WeekDay'))) as flag_D

Resident Data;

Drop Table Temp;

MK_QSL
MVP
MVP

Little update in the If statement is you want to calculate Festivals which are falling in WeekEnds.

IF(IsNull(HoliDay) and WeekDay(Dates) = 'Sat', 'WeekEnd',

  IF(IsNull(HoliDay) and WeekDay(Dates) = 'Sun', 'WeekEnd',

  IF(Not IsNull(HoliDay) and WeekDay(Dates) = 'Sat', 'WeekEndFestival',

  IF(Not IsNull(HoliDay) and WeekDay(Dates) = 'Sun', 'WeekEndFestival',

  IF(Not IsNull(HoliDay), 'Festival','WeekDay'))))) as flag_D

Not applicable
Author

but now when we select any state it does not gives any data about Week days and week ends

MK_QSL
MVP
MVP

Please check enclosed file.

Hope this will help you

MK_QSL
MVP
MVP

Hi, have you tried this?

Not applicable
Author

tried we need only three flags,

festival, weekend, Weekday, 

how to get that

and Calculation of holidays per state not comming Correct

MK_QSL
MVP
MVP

Let me know is it working for you or not?

Not applicable
Author

no its not working