Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dimension information not showing when joining to a fact

Hi,

I am joining a dimension to a fact table.  When viewing the information in the front end there is dimension information missing for some of the records in the fact table.

For example:

ProductType               #Transactions

Beer                                   1000

Shoes                                      50

Toys                                        250

-                                             2000

There are 2000 transactions which does not have a ProductType asscociated with it.  Could I make the '-' , 'Unknown'.  What would be the best way to handle this problem?

Thank you                             

5 Replies
Anonymous
Not applicable
Author

Hi Anto,

  It is because of outer join and data availability between the tables. So to put "Unknown" you can use

1)if condition in chart level

2) Apply map in script level.

Let me know still you need more clarification.

-Jai

devarasu07
Master II
Master II

Hi,

To fix your null value ('-') issue you have to update your dimension master table (i.e: product master it should contains all the fact product id desc. in this master table.)

and if you wish to update '-' as Unknown then u can write expression like below,

load *,

if(len(ProductType)<=0 or IsNull(ProductType) or ProductType='-','Unknown',ProductType) as [Product Revised];

LOAD * INLINE [

    ProductType,#Transactions

    Beer,1000

    Shoes,50

    Toys,250

    -,2000

];

Anil_Babu_Samineni

Try to interpret using Variable for that field

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hi Jai,

Could you give me an example of what the Apply map scripting would look like?

I tried the following with a mapping I did

ApplyMap('MapBranchToCustomer',Branch,null()) as BranchDescription

Thanks

HirisH_V7
Master
Master

Hi,

Check the both tables from business point of view,& determine what's the final view you wanna acheive.Accordingly use join or concatenate.

I think, that ProductType which got missed may have different type of transactions.

or

If at all , that's the final table means,use if condition.

Data:
LOAD *,
IF(ProductType='-','Unknown',ProductType) as ProductTypeNew

INLINE [
ProductType, #Transactions
Beer, 1000
Shoes, 50
Toys, 250
-, 2000

];

HTH,

Hirish

HirisH
“Aspire to Inspire before we Expire!”