A dimension from two columns

  • Hi! 

    A table has two columns named account_type & customer_type, both can have these possible values: 1, 0 & NULL.  I need to create a dimension with two levels.  The first one is the name of the column and the second is their values.  How can I do this?

    Thanks.

      

  • This was removed by the editor as SPAM

  • That doesn't make much sense.

     

    Which of the 2 columns that you have listed is going to be the source for your dimension?

    Regards

     

  • <quote>That doesn't make much sense.

    Which of the 2 columns that you have listed is going to be the source for your dimension?</quote>

    - Both... This is just an attept to make one dimension out of two, that are never analized one to another.  So a user should have the name of the column on the top level of hierarchy and the values on the bottom level.

  • <quote>That doesn't make much sense.

    Which of the 2 columns that you have listed is going to be the source for your dimension?</quote>

    - Both... This is just an attept to make one dimension out of two, that are never analized one to another.  So a user should have the name of the column on the top level of hierarchy and the values on the bottom level.

  • I think I understand your requirement. A dimension level can only be based on 1 field hence you'll need to build a view and use that as the source for your dimension.

    Try this:

    CREATE VIEW MyView

    AS

    SELECT

      'account_type' AS Level1

    , account_type AS Level2

    from <table_name>

    UNION ALL

    SELECT

      'customer_type' AS Level1

    , customer_type AS Level2

    from <table_name>

    Hope that helps

    Regards

     

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply