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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Holiday

Dear All,

I have two fields

1.With all dates in 2014

2.With all holidays in 2014

All i want is to have a field without Holidays.

(ie., I need to delete the holidays list in the field which has all days.)

How can i do that . Please help me.

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

In that case try like:

Table2:
Load * Inline [
HoliDays
1-1-2011
1-1-2014
];
Table1:
Load * Inline [
AllDates
1-1-2011
1-1-2012
1-1-2013
1-1-2014
];

WorkindDates:
Load AllDates as DateWorkingDays

Resident Table1 where not Exists(HoliDays, AllDates);

View solution in original post

9 Replies
tresB
Champion III
Champion III

Load

          FieldWithAllDates,

          FieldHolidays,

          If(FieldWithAllDates <> FieldHolidays, FieldWithAllDates) as WorkingDays

ashfaq_haseeb
Champion III
Champion III

Hi,

how do you define holiday,

by posting your Excel files can get accurate answer.

anyways try below.

Load HolidayDate,F5,F6 from holiday.xls;

load FullDate, F1,F2

from Full.xls where not exsists(HolidayDateFullDate);

Hope it helped.

Regards

ASHFAQ

Not applicable
Author

Hi Tresesco,

I have two fields, loaded already from two different tables.

It's not working. I also tried using Resident Statement.

But i can able to give only one table name in the Resident.

Is there any other way?

ashfaq_haseeb
Champion III
Champion III

Hi, try my solution or post sample files.

Regards

ASHFAQ

tresB
Champion III
Champion III

In that case try like:

Table2:
Load * Inline [
HoliDays
1-1-2011
1-1-2014
];
Table1:
Load * Inline [
AllDates
1-1-2011
1-1-2012
1-1-2013
1-1-2014
];

WorkindDates:
Load AllDates as DateWorkingDays

Resident Table1 where not Exists(HoliDays, AllDates);

Not applicable
Author

Hi Pradeep,

Try using LEFT KEEP.  Example below assumes you already have 2 tables loaded.  You'll need to come up with a common field for the join to work.  Below I used a %DateField_Id

[Holidays2014]:

LOAD Num(FieldHolidays) as %DateField_Id, 

     FieldHolidays

Resident [HolidaysTable];

    

[WorkingDays2014]:

LEFT KEEP ([Holidays2014])

LOAD Num(WorkingDays) as %DateField_Id,

     WorkingDays

Resident [WorkingDaysTable];

Anonymous
Not applicable
Author

hey,

check this

 

WD:

load * Inline
[
days
1/1/2014
1/2/2014
1/3/2014
1/4/2014
]
;
HD:
load * Inline
[
days
1/2/2014
]
;


New:
load count(days) as count,days
Resident WD Group by days;

DROP Table WD;

Final:
load *,'' as i
Resident New Where count=1;

drop Table New;
DROP Field i;

HTH

Ravi N.

ashfaq_haseeb
Champion III
Champion III

Hi,

Find the sample application attached.

Note:

I have taken Saturday and Sunday as holidays.

Regards

ASHFAQ

Not applicable
Author

It's works fine.

Thanks all for your great support.