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.

sebmueller87
Not applicable

Select and generate DATA from different tables

Hello everyoneSmiley Happy,

I haven't much experience in QV for now, but I'm try to get familiar with it (already knowing SQL)...

But now I've a problem, where I'm not able to discover the solution.

My Steps until now:

I'm loading two tables from an Excel File (that works fine) with the following result:

Sales_Shop:

Shop

Week

Category_Nr

Sales

ShopWeekCategory_NrSales
1492015105
349201510
4512015128

So Shop 3 doesnt have any sales in Category 10 and Week 492015.

Shop

Ref

ShopRef
31
......

So Table 2 has the following function: Every Shop will be assigned a Reference Shop (Ref). In this case the Ref for Shop 3 is Shop 1.

Now I have tried to get a third table with sales for every shop. The following logic should be applied.

If Shop X has sales in Category_Nr Y and Week Z than this Sales should be taken in the new table. If the Shop doesnt have real Sales, than the Sales from the Ref Shop should be taken into account. The Result should look like this:

ShopWeekCategory_NrSales
1492015105
3492015105
4512015128

So the red marked 5 in the last table are the Sales from Shop 1, which will be assigend to Shop 3 for this Week and Category_Nr, because Shop 3 doesnt have any real sales (look at table 1).

I have no idea to how to get this result, as I'm not so familiar with the syntax in QV:/

Thanks for all your help or adviceSmiley Happy

Tags (3)
1 Reply
petter
Not applicable

Re: Select and generate DATA from different tables

Actually I posted something with a flawed logic ... so I deleted that and posted this which should work:

2015-09-04 #1.PNG

2015-09-04 #2.PNG