Create matrix using a dimension containing the names of several measures and display their values conditionally row by row into a dummy measure

I am trying to create a table in which I display the measures names in rows while bringing their respective values (row by row) in a single column which I am calling “dummy_measure” in a way I can mix the solution with PoP analysis which in this case I am using the PoV solution found on this post: 

https://community.looker.com/lookml-5/use-refinements-to-add-period-over-period-functionality-to-exi...

Please, bear in mind that the image although fanning out, serves us well for illustration purposes, since aside from the fact that the dummy measure is taking the first measure tested in the condition and replicating its value to all the rows, the overall layout shown in the image is pretty much what I am trying to achieve as my end goal.

cb51cf3a-651f-4e6c-805a-7f93006e0593.png
12de989b-f4b2-4a19-81ef-9cecc3882db1.png

Here’s how I tried creating the dummy measure: 

  measure: dummy_measure_01 {
    type: sum
    sql:
          {%if ga_sessions.list_of_values._value != 'Sessions'%} ${ga_sessions.session_visits}
                {% else %}
                      {% if
                            ga_sessions.list_of_values._value != 'Transactions'%}${ga_sessions.transactions}
                      {% else %} ${ga_sessions.transactions}
                      {% endif %}
          {% endif %};;
  }

The idea behind the measure above is to attempt to have for each row and condition, the value being loaded from other distinct measures.

Has anyone ever faced similar problems who could share some thoughts about this case or even part of it (e.g. having a functional way to achieve the goal with having a Dummy measure properly calculating values row by row each based on other distinct measures would be awesome).

Best,

Solved Solved
0 1 1,047
1 ACCEPTED SOLUTION

I came up with the solution below, so if anyone reading this happen to find it useful in any way and decide to use and improve upon this, please consider sharing your improvements here to help the community, specially in formatting the output 🙂

1- Create a view to store your dimension with the name of the measures

7798f9f9-5cb8-4055-afdd-ca15072a43fb.png

2 - Join the new view to your Explore

f433b5bb-679f-49ea-b1e5-b9decb6ad70a.png

3 - Create your dummy measure

a129fb97-938b-4c03-aa40-d90218e40be1.png

View solution in original post

1 REPLY 1

I came up with the solution below, so if anyone reading this happen to find it useful in any way and decide to use and improve upon this, please consider sharing your improvements here to help the community, specially in formatting the output 🙂

1- Create a view to store your dimension with the name of the measures

7798f9f9-5cb8-4055-afdd-ca15072a43fb.png

2 - Join the new view to your Explore

f433b5bb-679f-49ea-b1e5-b9decb6ad70a.png

3 - Create your dummy measure

a129fb97-938b-4c03-aa40-d90218e40be1.png
Top Labels in this Space
Top Solution Authors