Loosing Lineage

  • Loosing Lineage

    Posted by DSC Communities on January 12, 2018 at 1:31 pm
    • William Rodriguez

      Member

      January 12, 2018 at 1:31 PM

      Greetings PUG community!

      How do I referenceĀ data model attributes from inside a query that broke its lineage?Ā 

      Thoughts:

      • I know possible solutions include joining the tables at ETL, restructuring the DAX query so that lineage isn’t broken, etc. My objective is to find if someone has figured how to reference the in-memory table directly from the query (see below)

      QUERY:

      EVALUATE

      GENERATE(
      Ā Ā Ā Ā SUMMARIZE (
      Ā Ā Ā Ā Ā Ā Ā Ā VARĀ VariableTableOne=Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā SUMMARIZE (
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā TABLEONE,Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā TABLEONE[COMMUNITY],Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā TABLEONE[HOUSENUMBER],Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā TABLEONE[OPTIONCODE]
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā )
      Ā Ā Ā Ā Ā Ā Ā Ā VAR VariableTableTwo=Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā SUMMARIZE (
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā TABLETWO,Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  TABLETWO[COMMUNITY],Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  TABLETWO[HOUSENUMBER],Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā  TABLETWO[OPTIONCODE]
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā )
      Ā Ā Ā Ā Ā Ā Ā Ā RETURN
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā UNION ( VariableTableOne, VariableTableTwo),Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā [COMMUNITY],Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā [HOUSENUMBER],Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā [OPTIONCODE]
      Ā Ā Ā Ā ) ,Ā 
      Ā Ā Ā Ā ROW (Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā “LOCATION” ,Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā CALCULATE(Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā FIRSTNONBLANK( TABLEONE[LOCATION] , 1 ) ,Ā 

      Ā //VIRTUAL RELATIONSHIP OPTION ONE (Ā IF THERE WAS LINEAGE, THE FOLLOWING VIRTUAL RELATIONSHIP WOULD TIE THE QUERY TO THE DATA MODEL)
      //THE PROBLEM IS THAT ‘VALUES’ NEEDS TO HAVE A FULLY QUALIFIED COLUMN… I WANT TO DIRECT IT TOWARD THE IN-MEMORY TABLE I AM CURRENTLY BUILDING

      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā INTERSECT(
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā VALUES ( TABLEONE[COMMUNITY] ) ,Ā 
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā VALUES( [COMMUNITY] )
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā ),Ā 
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā INTERSECT(
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā VALUES ( TABLEONE[HOUSENUMBER] ) ,Ā 
      //Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  VALUES ( [HOUSENUMBER]Ā )
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā ),Ā 
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā INTERSECT(
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā VALUES ( TABLEONE[OPTIONCODE] ) ,Ā 
      //Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  VALUES ( [OPTIONCODE] )
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā )
      Ā 
      //VIRTUAL RELATIONSHIP OPTION TWO (Ā IF THERE WAS LINEAGE, THE FOLLOWING VIRTUAL RELATIONSHIP WOULD TIE THE QUERY TO THE DATA MODEL)
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā FILTER(
      //Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  TABLEONE ,Ā 
      //Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  TABLEONE[COMMUNITY] = [COMMUNITY] &&
      //Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  TABLEONE[HOUSENUMBER] = [HOUSENUMBER] &&
      //Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  TABLEONE[OPTIONCODE] = [OPTIONCODE]
      //Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā )Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā 
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā )Ā Ā 
      Ā Ā  )
      )
      Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā 
      ORDER BY [COMMUNITY] , [HOUSENUMBER] , [OPTIONCODE]Ā Ā Ā Ā 

      #DAX?

      ——————————
      William Rodriguez
      Business Analyst
      ——————————

    DSC Communities replied 7 years, 8 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Loosing Lineage’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!