US and Worldwide: +1 (866) 660-7555
Results 1 to 4 of 4

Thread: How to map this schema

  1. #1
    Join Date
    Jun 2013
    Posts
    2

    Default How to map this schema

    My fact table has some columns like product_id, category_id, customer_id... etc;

    The problem is about the category_id column as its nullable, and my report must show "No Category" at this case...

    So i get something like this on database:

    product_id category_id customer_id
    1 null 1
    2 1 1
    2 1 2


    on sql i could do a left join on category and a case when null then 'No Category' on select statement....

    considering this, how can i map this dimension at my schema?!

    Thanks in advance and sorry about my english ok?

  2. #2
    Join Date
    Sep 2011
    Posts
    26

    Default

    I would create a "No Category" row in the category dimension table with category_id = 0. Then in the fact table you have to update nulls in the category_id column with 0's.

    This way you don't have to modify the schema.

  3. #3
    Join Date
    Jun 2013
    Posts
    2

    Default

    xgumara,

    thanks for your tip, but this is just what i can't do, because this concept is spreaded all over the app. furthermore, categories, like other entities, has complex relationships impacting on various aspects of the solution.

    There's another way to do this?

    Thanks

  4. #4
    Join Date
    Sep 2011
    Posts
    26

    Default

    Another option would be to use the <NameExpression> tag with an inside <SQL> query.
    Last edited by xgumara; 06-14-2013 at 04:05 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •