Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
embruqlikview
Contributor II
Contributor II

Problem with value in linked table

Hi there

I connect two tables. One with the facts, the other one with budget.

for both tables, i created a key with autonumber.

Now, in both tables, the key are matching. But there are rows, where the some values are missing.

I added a picture:

2016-12-24 02_52_55-QlikView x64 - [C__Users_rolf_Documents_QV Embru_Aussendienst test Join Warenber.png

the red area represents the budget table, the blue one the facts table. As we see, the key number 509 or 510 are correct in the blue area. But the key 508 has no values vc and wb. The Values VC=16 and WB=62 exists in the Fact-Table, but not shown by key 508.

I tried several keys, with and without Autonumber.

What i'm doing wrong?

Thanks for your help

Rolf

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

because in FACT Warenbereich 62 Doesn't exist for VC 16 , it Exist for VC = 22

1value.PNG

WB = 62 exists for WC = 22

value.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

7 Replies
vinieme12
Champion III
Champion III

So do you want the Fact table to have the same values as you have in the budget table?

then use Mapping Load

B_VC_MAPPING:

Mapping Load

KEY,

B_VC

FROM Budget;

B_WB_MAPPING:

Mapping Load

KEY,

B_WB

FROM Budget;

During FACT load add an extra validation to check and replace for nulls in VC and WB

FACT:

LOAD * ,

if(isnull(VC) or len(VC)<1,Applymap('B_VC_MAPPING',KEY),VC) as VC,

if(isnull(WB) or len(WB)<1,Applymap('B_WB_MAPPING',KEY),VC) as WB,

FROM YOURDATASOURCE;

But then what is point in having the same info in two separate tables??

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
embruqlikview
Contributor II
Contributor II
Author

Thank you for your fast answer.

i can’t map the values from the budget table to the fact table.

Because the Fact-Table contains the main data. The sum of them must be comparised to the budget table.

     In the Budget Table i do not need the field b_vc and b_wb - they are only to control the selection and the creation of the right key.

I added another picture of both tables. The Budget table is correct. But the key 508 points to the Fact-Record with the key 508 and here i loose the values WB and VC.

picture.png

The key e.g. 509 is correct.

Is this maybe a problem of the keys?

I build the keys on this way:


LOAD
 
AutoNumber (VC&'-'&WB&'-'&Jahr) as Key_Budget,
 
VC as B_VC,
   
WB as B_WB,
   
Budget,
   
Jahr as B_Jahr
FROM

(
qvd);

And in the Fact-Table:

AutoNumber (Vertreterschlüssel_1&'-'&Warenbereich&'-'&Mid(Auftragsdatum,1,4)) as Key_Budget,



vinieme12
Champion III
Champion III

OK,

I think your table is a  Straight Table

With Dimension = Key_Budget

Expression1 = WB

Expression2 = VC

Expression3 = Budget

Is this correct?

You have different values for VC and WB that is why they are showing as '-'

try  SUM(WB) and SUM(VC)

OR

move WB and VC to dimensions there must be multiple different values for this.

    

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
embruqlikview
Contributor II
Contributor II
Author

I added a sample qvw, it's simplier to show my question.

If you select in the list boxes above B_Jahr=2016 and B_VC=16 then you can see 4 budget-records with these amounts: 2000, 2000, 6000, 20000. The sum is 30'000.

Then clear the selections and select in the list boxes below Jahr=2016, Vertreterschlüssel_1=16, then we can see, that in the budget table only 3 records with the amount of 28'000 are available

vinieme12
Champion III
Champion III

because in FACT Warenbereich 62 Doesn't exist for VC 16 , it Exist for VC = 22

1value.PNG

WB = 62 exists for WC = 22

value.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
embruqlikview
Contributor II
Contributor II
Author

I see,

Thats exactly my problem.

Is there a way to generate the missing records in Facts Einzelposten during the load of Budget. Maybe that would resolve my problem. I found some examples in the community, but these show only small tables. I have to fill the key fields (B_YEAR->YEAR, B_VC -> VC, B_WB -> WB) and all other fields with initial values chosen by me.

Thanks for your help

Rolf

Miguel_Angel_Baeyens

You can use an outer join while loading the two tables, store into an QVD, then load that QVD and deal with the possible null values for clarity.

See more on the topic here: Generating Missing Data In QlikView | Qlik Community