Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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
chauhans85
Esteemed Contributor

Flag field based on another table

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;

4 Replies
chauhans85
Esteemed Contributor

Flag field based on another table

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;

Not applicable

Flag field based on another table

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

Re: Flag field based on another table

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

Re: Flag field based on another table

sorry it does work. thanks

dan

Community Browser