problem of calculating measures in foreign views

Hello, I would like to calculate the total of a measure (sum_dig_total_ht) in a foreign table but the displayed result is not correct. The value is high. how could i correctI give you my model and my views, so that you give me your point of view on my model, if it is optimal or if my joints are well done. Thanks
explore: derived_table_sales {
join: store {
type: left_outer
relationship: many_to_one
sql_on: ${derived_table_sales.id_store}=${store.id_store } ;;
}
join: derived_table_digital_sales {
type: left_outer
relationship: one_to_one
sql_on: ${derived_table_sales.id_store}=${derived_table_digital_sales.id_store} ;;
}
}


view: derived_table_digital_sales {
derived_table: {
sql: select
m.id_store,
m.surface,
sum(d.total_ht)
from tab.dig_sales as d
left join tab.store as m
on m.cd_store = d.code_store
group by 1,2
;;
}
}

view: derived_table_sales {
derived_table: {
sql: select
id_sales,
id_store,
date,
sum(total_ht)
from tab.sales
group by 1,2,3
;;
}

measure: sum_dig_total_ht {
type: sum
value_format_name: eur
sql: ${derived_table_digital_sales.total_ht} ;;
}
}
0 2 76
2 REPLIES 2
Top Labels in this Space
Top Solution Authors