Skip to Content
avatar image
Former Member

remove duplicate at universe level

My Data foundation layer has table (ie Mytable ) which retrieve its data from a database view (i.e. MyView), I need to remove duplicated from Myview at Universe level, and before doing any join with the reset of table in the universe

I want to make sure that the below scenarios are applied

  • 1.If the user select col1 from Mytable , I need the script to be generated as ( Select distinct Col1 from MyView )
  • 2.If the user select col1 and col2 from Mytable , I need the script to be generated as ( select Distinct Col1 , Col2 from Myview)

I already try different scenario to remove duplicated, but the generated SQL did not apply the above scenarios

My attempt

Make a derived table, from Mytable in the data foundation layer, which select distinct from the main table,

However, the generated Script if the user select Col1 is

Select col1 from (select distinct * from Myview) -> which is not what I need

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 06, 2017 at 11:15 AM

    Hi,

    trying to get it ... why do you have duplicates ? Can't you filter anything ? Is the aggregation of the records not working for you ?

    Grtz

    Koen

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      The Execution plan when the generated query is Select Distinct col1 from MyView

      is Better than when the generated query is Select col1 from myview

      So I am trying to force universe to write the keyword distinct in the generated query