Question

Dynamic labels for Join Dimensions/measures in an Explore

  • 13 January 2021
  • 0 replies
  • 24 views

Hi,

     We have a use case of dynamically giving labels to the fields within the views in an explore depending on where the join is occurring. 

Let’s take an example of three views:

View_A (dim_1, dim_2, measure_1)

View_B (dim_3, dim_4, measure_2)

View_C (dim_5, dim_6)

 

Now let’s say “View_C” represents a reference data view which is used in different explores and in this case twice in a singe explore. However I want the dimension label represent the “point of joining” using a dot notation. Let me explain further:

My explore :

explore: MyFirstExplore {

  view_label: "{{ _explore._name }}"

  from: View_A

               join: View_B
               {

                #Here I want all the dimensions to show up in my explore as “A.B.dim_3, A.B.dim_4 etc”
                from: View_B
                view_label: "{{ _explore._name }}"
                type: left_outer
                relationship: one_to_one
                sql_on: ${View_A.dim_1}=${View_B.dim_3}   ;;
                }

               join: View_C_to_A
               {

               # Here I want all the dimensions to show up in my explore as “A.C.dim_5, A.C.dim_6”
                from: View_C
                view_label: "{{ _explore._name }}"
                type: left_outer
                relationship: one_to_one
                sql_on: ${View_A.dim_2}=${View_C.dim_5}   ;;
                }

               join: View_C_to_B
               {

               # Here I want all the dimensions to show up in my explore as “A.B.C.dim_5, A.B.C.dim_6”
                from: View_C
                view_label: "{{ _explore._name }}"
                type: left_outer
                relationship: one_to_one
                sql_on: ${View_B.dim_4}=${View_C.dim_5}   ;;
                }

  1. I don’t want to hard-code a if statement in the view definition, because then each time a user creates a new explore the view definition will have to be touched.
  2. I want my Explore to look like this:

MyFirstExplore

  •         A.dim_1
  •         A.dim_2
  •         A.measure_1
  •         A.B.dim_3
  •         A.B.dim_4
  •         A.B.measure_2
  •         A.C.dim_5
  •         A.C.dim_6
  •         A.B.C.dim_5
  •         A.B.C.dim_6

Currently we are unable to override the view field names from within the explore without touching the view itself. Can you suggest a solution?

 


0 replies

Be the first to reply!

Reply