Inaccessible view user_mini-session referenced in retention

Hi, I am having some issues referencing a dimension from one view into another. (unable to post without the spaces in between some words)

dimension: retention {
type: d u r a t I o n d a y
s q l _ start: ${user . created _ date _ date} ;;
s q l _ end: ${user _ mini _ session . created _ date};;                                                                                                 The field I am referencing is ${user _ mini _ session . created _ date} where user_mini_session is the view name and I have followed the rules via online documentation. This is how the  dimension is currently saved via the other view:

dimension _ group: created {
type: time
timeframes: [raw, time, date, week, month, quarter, year, hour]
s q l: ${TABLE}."created At" ;;
}

The tables are also joined in the model, when I change the s q l _ end line the error has gone and is working fine. The explore itself with the error currently is calculating, I am just unable to save and push my changes to production.

The error I believe is due to the s q l _ end line, would I maybe need to create a derived table instead?

Appreciate any help here.

0 2 95
2 REPLIES 2

Hi @Rups ! Are there any instances where this view (users) is included in an explore where user_mini_session is not joined? If there are instances of this, you will see this error in the IDE, even if the field works in the Explores where the views are joined. To avoid this, make sure user_mini_session is joined to all explores that the the user view is in, or use the fields parameter to exclude this field from those explores.  

Hi Rups! Additionally, I noticed your retention dimension has type durationday instead of duration_day, and your created dimension group includes quotes in the sql parameter (sql: ${TABLE}."created At" ;;). Can you try using duration_day and removing the quotes around created_at?

You mentioned the views are joined in the model file - are you including both view files in the model file with the include parameter?

Top Labels in this Space
Top Solution Authors