Forum Discussion

marama's avatar
marama
Icon for Helper I rankHelper I
4 years ago

NATURALLEFTOUTERJOIN and different data types issue

Hi!
I've spent 2 hours trying to figure out why this code throws an error.
So I'm joing 2 summarized tables, using the ym (date type) and team_id (int) as relationship.
How can I verify the kelationship keys are really of the same type?

 

tab_vcu_team =
VAR A =
SELECTCOLUMNS(
SUMMARIZE(v_pbi_projects_ym
, v_pbi_projects_ym[ym]
, v_pbi_projects_ym[team_id]
, "revenue", SUM(v_pbi_projects_ym[valueadded])
)
, "ym", [ym], "team_id", [team_id], "revenue", [revenue])
VAR B =
SELECTCOLUMNS(
SUMMARIZE(v_pbi_person_ymd
, v_pbi_person_ymd[ym]
, v_pbi_person_ymd[team_id]
, "cost", SUM(v_pbi_person_ymd[cost_day])
)
, "ym", [ym], "team_id", [team_id], "cost", [cost])
VAR Result =
NATURALLEFTOUTERJOIN ( A, B )
RETURN
Result

 

 
Error. 
"An incompatible join column, (''[ym]) was detected. 'NATURALLEFTOUTERJOIN' doesn't support joins by using columns with different data types or lineage."