Created
April 6, 2018 18:23
-
-
Save mattm/c0ec061de7df8f046a9612358c3e211b to your computer and use it in GitHub Desktop.
Mixpanel Companies Derived Table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| view: mp_companies { | |
| derived_table: { | |
| sql: | |
| SELECT | |
| distinct_id, | |
| CAST(JSON_EXTRACT_SCALAR(properties, "$.com_id") AS INT64) AS com_id | |
| FROM mp.event | |
| WHERE name = "Signed Up" ;; | |
| } | |
| dimension: distinct_id { | |
| type: number | |
| sql: ${TABLE}.distinct_id ;; | |
| hidden: yes | |
| } | |
| dimension: com_id { | |
| label: "Company ID" | |
| type: number | |
| sql: ${TABLE}.com_id ;; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment