Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
didierodayo
Partner - Creator III
Partner - Creator III

Join after concaternate

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';

1 Solution

Accepted Solutions
didierodayo
Partner - Creator III
Partner - Creator III
Author

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;

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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

];

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
didierodayo
Partner - Creator III
Partner - Creator III
Author

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].

didierodayo
Partner - Creator III
Partner - Creator III
Author

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;