Dim Date table to another table How to create relationship? b/w two tables?

gkv
Participant I

Hi Team,

i have a 2 tables called product and dim_date.

now i have to create relationship b/w the two tables using dates column.

how can i create?

i tried this way but its showing error.

explore: product{

join:dim_date{

type:left_outer

relationship:one_to many 

sql: ${product.date}=${dim_date.date}

}

}

its showing error. if i change type and relationship also its showing error.

please help me on this and what are the possible ways to implement global dates.

0 8 357
8 REPLIES 8

Dawid
Participant V

What’s the error? Also it should be many_to_one

kuopaz
Participant IV

sql: ${product.date}=${dim_date.date}

Try using sql_on:

gkv
Participant I

@kuopaz  i tried using sql also

sql: ${product.date}=${dim_date.date}

Try using sql_on:

kuopaz
Participant IV

It should be: 

sql_on: ${product.date}=${dim_date.date} ;;

gkv
Participant I

@Dawid Query execution failed: - Syntax error: Expected end of input but got "(" at [5:1]

Dawid
Participant V

Look through your code carefully, I’m not sure if you copied the whole thing or just parts. You need ;; (double semicolon) at the end of the sql paramter

gkv
Participant I

Look through your code carefully, I’m not sure if you copied the whole thing or just parts. You need ;; (double semicolon) at the end of the sql paramter

@Dawid Here is the example data:

explore: calls {
  join: dim_date {
    type: left_outer
    relationship: many_to_one
    sql: ${calls.date}= ${dim_date.id_date} ;;
  }

gkv
Participant I

I got it simple we have to write sql_on in presence of sql

explore: calls {
  join: dim_date {
    type: left_outer
    relationship: many_to_one
    sql_on: ${calls.date}= ${dim_date.id_date} ;;
  }

thanks for responding soon

Top Labels in this Space
Top Solution Authors