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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Linking two tables some rows only

I've been trying to find a solutions to the following:

I have a sales table as follows:

ItemItemGroupBuyerMonthWeekQty
121A201001182
233A201001158
32B201001176
43B201001159
121A201001277
233A201001229
32B201001255
43B201001260




121A201205155
233A201205111
32B201205196
43B201205166
121A201205286
233A201205275
32B201205274
43B201205282

and Forecast table as follows:

ItemGroupBuyerMonthForecastQty
21A20120191
33A20120110
2B20120127
3B2012014
21A20120274
33A20120255
2B20120252
3B20120267
21A20120310
33A20120312
2B20120345
3B2012037




21A20130124
33A2013013
2B2013014
3B20130187

Note that the sales are for many years and forecast for current fiscal year. I wanted to build a chart with current sales and forecast qty for each month. In order to do this I created a key from ItemGroup, Buyer and 2 right most digits of Month. The same key was created in sales table.

My problem is since the same key exists mutiple times in the sales table when I use right(Month,2) as my dimension and sum(ForecastQty) as expression I get multiples of the forecast Qty. In order to solve this problem I used sum(DISTINCT ForecastQty) but I have a feeling this is not the best solution.

Is there a way I can limit a single row for key from sales to be associated with the forecast? Rather than having a many to one connection I would like to force one to one from sales to forecast. This way my sum would be accurate and I wouldn't have to use sum(DISTINCT ForecastQty)?

Thanks,

G

11 Replies
Not applicable
Author

Hi Teemu,

I think the concatenate is ok as long as you don't have to display sales and forecast in same table. My needs are to display past 2 years sales, along with current sales and forecast in same table. Further more I have to be able to drill down to the buyer and product category.

I wanted to find join the forecast data with few records from my sales data. I know that creating a key that can be used to link the two tables is good but I need to elimintate Many to One (from sales to forecast) and create one-to-one connection somehow.

Grif

teempi
Partner - Creator II
Partner - Creator II

Hi,

I still think that my solution would give you everything you need assuming I've understood correctly what you mean. I'd appreciate if you could create an example table using the tools on the forum (Advanced Editor --> Insert Table).

-Teemu