Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

where exists help

Hi, i have this situation::

TableA:

number    nameA

1    aaaa

2    bbbb

3    cccc   

4    dddd

5    ffff

6    gggg

tableB:

number    nameB

1    XXXXX

2    YYYYY

5    RRRRR

I want to show in qlikview TableA and TableB, but in TableB only the rows that number from TableB exist in TableA. The way it is now, it shows:

1    XXXXX

2    YYYYY

3    -

4    -

5    RRRRR

6    -

How can I do that? Is there a way to do without create a 3rd table ? maybe with "where exists", but how?

thanks

1 Solution

Accepted Solutions
pgrenier
Not applicable

Re: where exists help

Holà Juliano,

This is what you can do to accomplish this:

where_exists_help.jpg

Regards,

Philippe

5 Replies
jontydkpi
Not applicable

Re: where exists help

Hi

Not sure I understand, but if you have a straight table dimensioned with the field "number", then the expression =Only(nameB) will display the way you show in your example.

If you want to show the nulls, then ensure that the suppress zero and suppress null options are off.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Gabriel
Not applicable

Re: where exists help

HI,

I think best option is to use LEFT KEEP, meaning Table B will only show common fields.

TableA:

number    nameA

1    aaaa

2    bbbb

3    cccc  

4    dddd

5    ffff

6    gggg

tableB:

LEFT KEEP  (TableA)

number    nameB

1    XXXXX

2    YYYYY

5    RRRRR

Hope this is helpful?

Best Regards,

Gabriel

pgrenier
Not applicable

Re: where exists help

Holà Juliano,

This is what you can do to accomplish this:

where_exists_help.jpg

Regards,

Philippe

celambarasan
Not applicable

Re: where exists help

Swap the order and use left keep.

tableB:

number    nameB

1    XXXXX

2    YYYYY

5    RRRRR

Left Keep(tableB)

TableA:

number    nameA

1    aaaa

2    bbbb

3    cccc  

4    dddd

5    ffff

6    gggg

Not applicable

Re: where exists help

Thank you all, Philippe Grenier answer is what I was looking for.