Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
vksthkkr
Contributor III
Contributor III

Getting data through a Join

Hi,

I have a simple Distributor/Retailer sales setup as shown below:

Retailer & Distributor Table are Customer profiles and the *_Qty tables are sales data. The NRV_Points table has prices and points.

Untitled.png

I want to get Dist_State corresponding to the Ret_ID for every record in the Retailer_Qty table.

I am using the below script for this:

Inner Join (Retailer_Qty)

LOAD Distinct

  Dist_State as Ret_Qty_Dist_State

Resident Distributor;

This script is creating multiple values for every single Ret_ID (one for every state) in the Retailer_Qty table.

Not sure where the error/issue is.

Looking for some help on this.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

You should have a key while joining

Inner Join (Retailer_Qty)

LOAD Distinct

  Ret_ID,

Dist_D

resident

Retailer;

inner join

LOAD distinct,

  Dist_D,

  Dist_State as Ret_Qty_Dist_State

Resident Distributor;

drop fields Dist_D from Retailer_Qty;

View solution in original post

2 Replies
Clever_Anjos
Employee
Employee

You should have a key while joining

Inner Join (Retailer_Qty)

LOAD Distinct

  Ret_ID,

Dist_D

resident

Retailer;

inner join

LOAD distinct,

  Dist_D,

  Dist_State as Ret_Qty_Dist_State

Resident Distributor;

drop fields Dist_D from Retailer_Qty;

vksthkkr
Contributor III
Contributor III
Author

Thanks Clever Anjos

This worked