Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have table A and table B. Table A has date, dateid; table B has dateid. Dateid is the key between them. I want to show date in table A only when dateid exist in Table B. In another word, I want to show the date corresponding to dateid in table B. What should I do? Note there are more values of dateid in table A than table B.
Hi,
Here are the two options that come to mind ad hoc: Left Keep and Where Exists:
TABLE_B:
LOAD * INLINE [
DATEID
3
4
5
];
LEFT KEEP(TABLE_B)
TABLE_A:
LOAD * INLINE [
DATEID
3
4
1];
OR
TABLE_B:
LOAD
DATEID AS %KEY,
DATEID AS DATEIDTEMP
INLINE [
DATEID
3
4
5
];
TABLE_A:
LOAD DATEID AS %KEY,
DATEID
INLINE [
DATEID
3
4
1]
Where Exists(DATEIDTEMP, DATEID);
Both results return precisely the rows that exist in Table_B.
Best regards Son
Hi,
Here are the two options that come to mind ad hoc: Left Keep and Where Exists:
TABLE_B:
LOAD * INLINE [
DATEID
3
4
5
];
LEFT KEEP(TABLE_B)
TABLE_A:
LOAD * INLINE [
DATEID
3
4
1];
OR
TABLE_B:
LOAD
DATEID AS %KEY,
DATEID AS DATEIDTEMP
INLINE [
DATEID
3
4
5
];
TABLE_A:
LOAD DATEID AS %KEY,
DATEID
INLINE [
DATEID
3
4
1]
Where Exists(DATEIDTEMP, DATEID);
Both results return precisely the rows that exist in Table_B.
Best regards Son
If you want to do this in a chart, one method is:
=Aggr(Only({$*<somefield={*}>}date), date)
where "somefield" is a field that exists only in Table B.
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com