Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all ,
am trying to find the best way to achieve the scenario below. I have attached the qvw file as well.
Basically I need to join Table B to Table A in the example below.
thanks
TableA:
LOAD * INLINE [CATEGORY,DATE
A,MONDAY
B,TUESDAY
C,WEDNESDAY
D,THURSDAY
E,FRIDAY
F,SATURDAY
];
TableB:
LOAD DATE,'M' AS [DATE CODE] Resident TableA WHERE DATE='MONDAY';
Concatenate (TableB)
LOAD DATE,'F' AS [DATE CODE] Resident TableA WHERE DATE='FRIDAY';
fixed
TableA:
LOAD * INLINE [CATEGORY,DATE
A,MONDAY
B,TUESDAY
C,WEDNESDAY
D,THURSDAY
E,FRIDAY
F,SATURDAY
];
TableB:
LOAD DATE,'M' AS [DATE CODE] Resident TableA WHERE DATE='MONDAY';
Concatenate (TableB)
LOAD DATE,'F' AS [DATE CODE] Resident TableA WHERE DATE='FRIDAY';
Left Join (TableA)
load * Resident TableB;
drop Table TableB;
I am not sure what you are tryiing to do. You don't even need a join in your scenario. You can leave the data in two separate tables and rely on QV's association. Or you can load the DATE CODE in the Inline script, like
TableA:
LOAD *,
If(DATE = 'MONDAY', 'M',
If(DATE = 'FRIDAY', 'F')) as [DATE CODE]
INLINE
[
CATEGORY,DATE
A,MONDAY
B,TUESDAY
C,WEDNESDAY
D,THURSDAY
E,FRIDAY
F,SATURDAY
];
Hi Jonathan,
I have a complex model this was just an example. my requirement is that to dump table b back into table A and have only one tableA with columns CATEGORY;DATE;[DATE CODE].
fixed
TableA:
LOAD * INLINE [CATEGORY,DATE
A,MONDAY
B,TUESDAY
C,WEDNESDAY
D,THURSDAY
E,FRIDAY
F,SATURDAY
];
TableB:
LOAD DATE,'M' AS [DATE CODE] Resident TableA WHERE DATE='MONDAY';
Concatenate (TableB)
LOAD DATE,'F' AS [DATE CODE] Resident TableA WHERE DATE='FRIDAY';
Left Join (TableA)
load * Resident TableB;
drop Table TableB;