Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Flag field based on another table

Hi All

I would like to add a field to Table A based on the fourmula (IF(WeekDayNUmber = 3, 1,2), However WeekDayNumber is a field in Table B. Any advice on hwo best to go about thsi woudl be great. Please see the atatched test document.

Thanks

Dan

1 Solution

Accepted Solutions
SunilChauhan
Champion II
Champion II

A:
LOAD DateActual
FROM
Test.xls
(biff, embedded labels, table is A$);

B:
LOAD DateActual,
     WeekdayNumber,
     DayOfMonthNumber,
     CYDayOfYearNumber,
     CYWeekOfYearNumber,
     CYMonthNumber,
     [CY Quarter],
     [CY Year],
     [CY Year Month],
     [CY Year Month Name],
     [CY Year Month Short],
     [CY Year Quarter],
     FYDayOfYearNumber,
     FYWeekOfYearNumber,
     FYMonthNumber,
     [FY Quarter],
     [FY Year],
     [FY Year Month],
     [FY Year Month Name],
     [FY Year Month Short],
     [FY Year Quarter],
     [Out of Hours]
FROM
Test.xls
(biff, embedded labels, table is B$);


left Join(A)

Load DateActual,
WeekdayNumber as WeekdayNumber1
resident B;

C:
Load
DateActual

if(WeekdayNumber1=3,1,2) as Flag
resident A;

drop table A;

Sunil Chauhan

View solution in original post

4 Replies
SunilChauhan
Champion II
Champion II

A:
LOAD DateActual
FROM
Test.xls
(biff, embedded labels, table is A$);

B:
LOAD DateActual,
     WeekdayNumber,
     DayOfMonthNumber,
     CYDayOfYearNumber,
     CYWeekOfYearNumber,
     CYMonthNumber,
     [CY Quarter],
     [CY Year],
     [CY Year Month],
     [CY Year Month Name],
     [CY Year Month Short],
     [CY Year Quarter],
     FYDayOfYearNumber,
     FYWeekOfYearNumber,
     FYMonthNumber,
     [FY Quarter],
     [FY Year],
     [FY Year Month],
     [FY Year Month Name],
     [FY Year Month Short],
     [FY Year Quarter],
     [Out of Hours]
FROM
Test.xls
(biff, embedded labels, table is B$);


left Join(A)

Load DateActual,
WeekdayNumber as WeekdayNumber1
resident B;

C:
Load
DateActual

if(WeekdayNumber1=3,1,2) as Flag
resident A;

drop table A;

Sunil Chauhan
Not applicable
Author

Hi Thanks

for the reply. WOuld this be the same if i were loading my tables from MS Access? It does not seem to like :

left Join(A)

Load DateActual,
WeekdayNumber as WeekdayNumber1
resident B;

thanks again

dan

Not applicable
Author

Hi Thanks

for the reply. WOuld this be the same if i were loading my tables from MS Access? It does not seem to like :

left Join(A)

Load DateActual,
WeekdayNumber as WeekdayNumber1
resident B;

thanks again

dan

Not applicable
Author

sorry it does work. thanks

dan