Sie sind auf Seite 1von 2

Link Tables and Concatenation

Link Tables are used to marry up information that has different levels of detail, or frequency of occurrence. Generally, they occur when the metrics being measured do not have the same base of time. Step 1 Do: Open up the XL file LinkTable and examine the sales as well as the budget. You will see that there is a Budget for each customer but not all customers purchase goods each month. Now open and reload the LinkTabel.QVW. All the information looks correct. Go to the Table Viewer and look at the structure of the Tables and Links. A Synthetic Key is made. This can cause overhead to the application and in some rare cases can return unexpected results. Step 2 Do: Comment out the information on the SynKey Tab, uncomment the script on the Using a Key Tab reload the application. You will notice that we are trying to get rid of the Synthetic Key by the concatenation of the keys that are causing the Synthetic table. Check the result from the QVW and compare them to the XL sheet. You can see that we are returning incorrect information. Step 3 Do: Comment out the script on the Using a Key table and uncomment out the script on the Link Table Tab. Here we are loading the information from the Sales and Budget table 2 times. This is to generate an intermediate table that has common information from both the tables and the level of detail is maintained in separate tables for both the Sales and Budget. The link table must be loaded Distinct and it will facilitate a correct relationship. Step 3 Do: Comment out the code in step 3 and uncomment out the code on Tab labeled concatenate, then reload the application. Look at the result. You will see the same result as Step 1 and Step 3. Create a Table that includes all the columns. There is a table that looks like

Notice that there are null values. Now if you sum Sales Amount and Budget Amount they will balance. Note: (this very similar to a union in SQL and null values do not have a high cost in QV as they normally do in SQL)