Forum Discussion

learning2022's avatar
learning2022
New Member
4 years ago

Comparing data in two tables with different columns

Hi

 

I am trying to compare data in two tables with the following scenarios. 

 

Scenario 1 

 

Same number of columns and match the data. Results should highlight the differences in the data.

 

Scenario 2

 

Different number of columns and match the data.  Results should highlight the differences in the data.

 

Currently, I am using the following query, however, the issue is that I have to create comparisons (through measures) for each column.  Is it possible to simplify this formula so that it can cover the entire table in one go?

GoalTypeMatch = 
var _cloupra_goals_type = SELECTEDVALUE(Cloupra_Goal[cloupra__Type__c])
var _practifi_goals_type = SELECTEDVALUE(practifi__Goal__c[practifi__Type__c])
return
if (_cloupra_goals_type=_practifi_goals_type,"Match", "No Match")

Thanks

2 Replies

  • rbriga's avatar
    rbriga
    Icon for Impactful Individual rankImpactful Individual

    Assuming the columns have the same name:

    1. In the query editor, add a manual "source" column.
      1. The value will be [Table 1 name] and [Table 2 name]
    2. Union these 2 tables ("Append Queries" in the query editor).
    3. Create a matrix on the new, appended table.
      1. Each coulumn in the table will go into the matrix values as distinct count
      2. "Source" will go into the matrix columns
    4. If the tables are the same, "distinct count" of any column will show Table1 = Table2 = Total
    5. You can expend on that by adding ID fields to find the difference if needed.
  • Hi learning2022 ,

    Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

     

    Best Regards,
    Community Support Team _ kalyj