Add product_line dimension, use user attributes in sql_always_where Change-Id: I7a454c5340dc10044bc5717b19f873f0937d5267
diff --git a/explores/gcc_revenue_partitioned.view.lkml b/explores/gcc_revenue_partitioned.view.lkml index 5115d12..d8267ae 100644 --- a/explores/gcc_revenue_partitioned.view.lkml +++ b/explores/gcc_revenue_partitioned.view.lkml
@@ -1,5 +1,8 @@ include: "/views/revenue/gcc_revenue_partitioned.view.lkml" explore: gcc_revenue_partitioned { - sql_always_where: ${access_key_hierarchy} like '%hdeist%' ;; + + sql_always_where: true + and ${access_key_hierarchy} like concat('%', replace('{{ _user_attributes['email']}}', '@google.com', ''), '%') + and ${product_line} = '{{ _user_attributes['product_line'] }}';; }
diff --git a/views/revenue/gcc_revenue_partitioned.view.lkml b/views/revenue/gcc_revenue_partitioned.view.lkml index ef42ed3..5056e85 100644 --- a/views/revenue/gcc_revenue_partitioned.view.lkml +++ b/views/revenue/gcc_revenue_partitioned.view.lkml
@@ -13,6 +13,13 @@ type: string sql: ${TABLE}.billing_account_id ;; } + + dimension: product_line { + description: "product_line" + type: string + sql: ${TABLE}.product_line ;; + } + dimension: access_key_hierarchy { description: "access_key_hierarchy" type: string @@ -32,6 +39,6 @@ dimension: ldap { description: "ldap" type: string - sql: SPLIT('{{_user_attributes['email'] }}', "@")[SAFE_OFFSET(0)];; + sql: replace('{{_user_attributes['email'] }}', '@google.com', '');; } }