Forum Discussion

TobiasF's avatar
TobiasF
Icon for Advocate I rankAdvocate I
8 years ago
Solved

How to Logically Compare Table01[CategoryID] with Table02[CategoryID] dynamically

Hi, I'm having a hard time wrapping me head around the following.  I want to logically compare Table01[CategoryID] with Table02[CategoryID].     When the data is read and it gets to Table01[C...
  • TobiasF's avatar
    8 years ago

    Here is how I solved this. 

    Problem was because the column values I wanted to compare resided in two different tables. 

    factTable[ColumnA]
    dimTable[ColumnB]

    1. I Used Query Editor to Merge the factTable with the DimTable[ColumnB] I want to compare to. 

    (Basically it copied ColumnB from DimTable to factTable. For this to work you need a relationship between the

    two tables that work which I had).

     

    Now both of the Columns I want to compare exist in the same table. 

    2. I used Query Additor => Add Column => Conditional Colum     on my factTable.

    There I configured IF factTable[ColumnA] Equal To  factTable[ColumnB] Set the value of the new conditional column to True

    Else if IF factTable[ColumnA] Not Equal To factTable[ColumnB] Set the value of the new conditional column to False

     

    Otherwise set value of new conditional colum to Problem.

    This effectivaly creates a TRUE/FALSE flag that I can filter on.

    From this I was able to create a Calculated Column based on my needs where I simply added a filter of factTable[ColumnB] = "True".