1

I am using Firebase for collecting events from my application.

For example lets say I have an event print_attempt and it has 2 parameters page_count and copies. Something like this..

event {
   name: print_attempt
   param {
     name: copies
     int_value: 10
   }
   param {
     name: page_count
     int_value: 5
   }
 }

Now in Google Data Studio, I want to have a metric total page printed. How do I multiply 2 param values?

SUM(CASE WHEN Event Param Name = "page_count" THEN Event Param Value Int ELSE 0 END)

returns me the sum of page_count but in this scenario copies value is ignored.

I tried following, but this gives me error.

SUM(CASE 
      WHEN Event Param Name = "page_count" THEN (
              Event Param Value Int * CASE WHEN EVENT PARAM NAME ="copies" THEN 
              Event Param Value Int ELSE 1 END) 
      ELSE 0 END)

Any pointers?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Naveen
  • 343
  • 1
  • 3
  • 13

1 Answers1

2

I got the answer from here.

It is not possible directly because the connector works with a flattened schema where the int values that I am trying to multiply will be in different records.

I ended up adding another int parameter in the event ex. total_pages with the value of page_count*copies.

Other solution could be to make a view or table where page_count and copies are as separate column of a row.

Naveen
  • 343
  • 1
  • 3
  • 13