Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If exist

Don't know how to do this....

From table A I load the rows ITEM, DESCRIPTION for one specific store

From table B I load the rows ITEMID, COST PRICE, SALES PRICE

In the load script I only want to get the cost price and sales price from the items that was loaded from table A

ITEM in table A is the same as ITEMID from table B

How to do this?

I've tried with "where exist" and left keep but I'm not sure that I use the correct syntax.

Please help

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Like this:

TableA:

Load ITEM, DESCRIPTION from ....

left keep (TableA)

TableB:

Load ITEMID as ITEM, COST PRICE, SALES PRICE from ...


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
Not applicable
Author

in order to use where exist your fields have to have the same name. meaning that either you rename ITEM to ITEMID or the opposit way.

regards,

MT

sasikanth
Master
Master

hi

Use Applymap function

you will get the output

Gysbert_Wassenaar

Like this:

TableA:

Load ITEM, DESCRIPTION from ....

left keep (TableA)

TableB:

Load ITEMID as ITEM, COST PRICE, SALES PRICE from ...


talk is cheap, supply exceeds demand
its_anandrjs

Try to load your table like

table A

Load

ITEM, DESCRIPTION

From Location;

table B

Load

ITEMID, COST PRICE, SALES PRICE

From Lcoation

Where Exists(ITEM,ITEMID);

PradeepReddy
Specialist II
Specialist II


If you want data

1) 2 seperate tables, use the 'Left Keep'

2) in single table, use the 'Left join'

sasikanth
Master
Master

Load  * from

TAB_B;

TAB_A:

load * Inline [

ITEM,DESCIPTION

.

.

.];

Load

ApplyMap(ITEMID,Descrption) as ITEM,

Costprice,

Selling price

resident TAB_B;

its_anandrjs

Or you can use simple join if you want data based on the first table then use join with (Left,Right,Inner) based on the requirement.

tableA:

Load

ITEM, DESCRIPTION

From Location;

Join

tableB:

Load

ITEMID, COST PRICE, SALES PRICE

From Lcoation

Where Exists(ITEM,ITEMID);

Not applicable
Author

You can use exists like this:

A:

Load ITEM,

  DESCRIPTION

From ...;

B:

Load

  ITEMID,

  COST,

  PRICE,

  SALES,

  PRICE

From ...

Where exists(ITEM,ITEMID);

/Ida