Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nonequality Join in QV?

Hi Everyone,

I have the below scenario. I have table A with sales information and i have table B with promotions information. Based on the price in sales table i want to appy the promotion. I want to get the result which is shown in final table. In oracle ,to get this result i can simply write the following query. Do we have any easy way to get this result using QV script.

Oracle Script to get the final result:

select A*,B.Promotion

from sales A,Promotions B

where A.Price between B.Min Price and B.Max Price;

Sales table
Itemnoprice
110
220
310
430


Promotions table
Min PriceMax PricePromotion
110$2 Rebate
1130Free shipping


Final Table
ItemnopricePromotion
110$2 Rebate
220Free shipping
310$2 Rebate
430Free shipping


1 Solution

Accepted Solutions
Not applicable
Author

im new in QV. but you can try like this one.


sales table:
load * from sales_table;
promotion_table:
load * promotion_table;
intervalmatch:
intervalmatch(price)
load minprice,
maxprice
resident promotion_table;
left join(sales_table) load * resident intervalmatch;
left join(sales_table) load * resident promotion_table;


View solution in original post

2 Replies
Not applicable
Author

im new in QV. but you can try like this one.


sales table:
load * from sales_table;
promotion_table:
load * promotion_table;
intervalmatch:
intervalmatch(price)
load minprice,
maxprice
resident promotion_table;
left join(sales_table) load * resident intervalmatch;
left join(sales_table) load * resident promotion_table;


Not applicable
Author

Excellent. The solution worked fine. Thank you verymuch.