Retrieve all intelligent attributes

Retrieves all intelligent attributes. You may also want to retrieve your bucket attributes.

For more information about the ready-to-use intelligent attributes in Oracle Unity, refer to the Unity Help Center.

Request Method Service URL

GET

/api-metadata/v1/{access-key}/metadata/aggregatedtables/{aggregatedTableId}/aggregatedattributes

Request Headers

Content-Type=application/json

Examples

Request

Retrieve all intelligent attributes for the mastercustomer master entity:

http://{AccountURL}/api-metadata/v1/e2a7a0df2410470d85ef69c8dad2bdb8/metadata/aggregatedtables/mastercustomer/aggregatedattributes

Response

{
  "tenantId": 100173,
  "name": "Total Spent Amount",
  "versionTS": 1581704867050,
  "description": "Total Spent Amount",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190927756,
  "tableId": "MasterCustomer",
  "attributeId": "total_spent_amt",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "total_spent_amt",
    "alias": "total_spent_amt"
  }
},
{
  "tenantId": 100173,
  "name": "Total Returns Amount",
  "versionTS": 1581704867135,
  "description": "Total Returns Amount",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190927788,
  "tableId": "MasterCustomer",
  "attributeId": "total_returns_amt",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "total_returns_amt",
    "alias": "total_returns_amt"
  }
},
{
  "tenantId": 100173,
  "name": "Total Return Count",
  "versionTS": 1581704867213,
  "description": "Total Return Count",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190927818,
  "tableId": "MasterCustomer",
  "attributeId": "total_return_count",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "total_return_count",
    "alias": "total_return_count"
  }
},
{
  "tenantId": 100173,
  "name": "Total Purchase Count",
  "versionTS": 1581704867301,
  "description": "Total Purchase Count",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190927847,
  "tableId": "MasterCustomer",
  "attributeId": "total_purchase_count",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "total_purchase_count",
    "alias": "total_purchase_count"
  }
},
{
  "tenantId": 100173,
  "name": "Total Order Count",
  "versionTS": 1581704867416,
  "description": "Total Order Count",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190927874,
  "tableId": "MasterCustomer",
  "attributeId": "total_order_count",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "total_order_count",
    "alias": "total_order_count"
  }
},
{
  "tenantId": 100173,
  "name": "Total Opened Count",
  "versionTS": 1581704867527,
  "description": "Total Opened Count",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190927903,
  "tableId": "MasterCustomer",
  "attributeId": "total_opened_count",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_EventCube",
    "attributeName": "total_opened_count",
    "alias": "total_opened_count"
  }
},
{
  "tenantId": 100173,
  "name": "Total Delivered Count",
  "versionTS": 1581704867617,
  "description": "Total Delivered Count",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190927932,
  "tableId": "MasterCustomer",
  "attributeId": "total_delivered_count",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_EventCube",
    "attributeName": "total_delivered_count",
    "alias": "total_delivered_count"
  }
},
{
  "tenantId": 100173,
  "name": "Total Clicked Count",
  "versionTS": 1581704867710,
  "description": "Total Clicked Count",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190927960,
  "tableId": "MasterCustomer",
  "attributeId": "total_clicked_count",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_EventCube",
    "attributeName": "total_clicked_count",
    "alias": "total_clicked_count"
  }
},
{
  "tenantId": 100173,
  "name": "Top Product Category",
  "versionTS": 1581704867795,
  "description": "Top Product Category",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190927989,
  "tableId": "MasterCustomer",
  "attributeId": "top_product_category",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "top_product_category",
    "alias": "top_product_category"
  }
},
{
  "tenantId": 100173,
  "name": "Top Product",
  "versionTS": 1581704867887,
  "description": "Top Product",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190928018,
  "tableId": "MasterCustomer",
  "attributeId": "top_product",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "top_product",
    "alias": "top_product"
  }
},
{
  "tenantId": 100173,
  "name": "SMS Open Rate",
  "versionTS": 1583969459695,
  "description": "SMS Open Rate",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928048,
  "tableId": "MasterCustomer",
  "attributeId": "sms_open_rate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CASE",
    "attributes": [
      {
        "atype": ".CriteriaAttribute",
        "criteria": {
          "ctype": ".Criteria",
          "operator": "EQUALS",
          "operands": [
            {
              "ctype": ".FunctionAttribute",
              "type": "CUSTOM",
              "attributes": [
                {
                  "atype": ".ReferenceAttribute",
                  "tableName": "CA_EventCube",
                  "attributeName": "total_sms_sent_count"
                },
                {
                  "atype": ".StaticAttribute",
                  "data": 0
                }
              ],
              "functionName": "COALESCE"
            },
            {
              "ctype": ".StaticAttribute",
              "data": 0
            }
          ]
        }
      },
      {
        "atype": ".StaticAttribute",
        "data": 0
      },
      {
        "atype": ".FunctionAttribute",
        "type": "DIVIDE",
        "attributes": [
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_sms_opened_count"
          },
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_sms_sent_count"
          }
        ]
      }
    ],
    "alias": "sms_open_rate"
  }
},
{
  "tenantId": 100173,
  "name": "SMS Click Rate",
  "versionTS": 1583969459813,
  "description": "SMS Click Rate",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928079,
  "tableId": "MasterCustomer",
  "attributeId": "sms_click_rate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CASE",
    "attributes": [
      {
        "atype": ".CriteriaAttribute",
        "criteria": {
          "ctype": ".Criteria",
          "operator": "EQUALS",
          "operands": [
            {
              "ctype": ".FunctionAttribute",
              "type": "CUSTOM",
              "attributes": [
                {
                  "atype": ".ReferenceAttribute",
                  "tableName": "CA_EventCube",
                  "attributeName": "total_sms_sent_count"
                },
                {
                  "atype": ".StaticAttribute",
                  "data": 0
                }
              ],
              "functionName": "COALESCE"
            },
            {
              "ctype": ".StaticAttribute",
              "data": 0
            }
          ]
        }
      },
      {
        "atype": ".StaticAttribute",
        "data": 0
      },
      {
        "atype": ".FunctionAttribute",
        "type": "DIVIDE",
        "attributes": [
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_sms_clicked_count"
          },
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_sms_sent_count"
          }
        ]
      }
    ],
    "alias": "sms_click_rate"
  }
},
{
  "tenantId": 100173,
  "name": "Push Open Rate",
  "versionTS": 1583969459923,
  "description": "Push Open Rate",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928109,
  "tableId": "MasterCustomer",
  "attributeId": "push_open_rate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CASE",
    "attributes": [
      {
        "atype": ".CriteriaAttribute",
        "criteria": {
          "ctype": ".Criteria",
          "operator": "EQUALS",
          "operands": [
            {
              "ctype": ".FunctionAttribute",
              "type": "CUSTOM",
              "attributes": [
                {
                  "atype": ".ReferenceAttribute",
                  "tableName": "CA_EventCube",
                  "attributeName": "total_push_opened_count"
                },
                {
                  "atype": ".StaticAttribute",
                  "data": 0
                }
              ],
              "functionName": "COALESCE"
            },
            {
              "ctype": ".StaticAttribute",
              "data": 0
            }
          ]
        }
      },
      {
        "atype": ".StaticAttribute",
        "data": 0
      },
      {
        "atype": ".FunctionAttribute",
        "type": "DIVIDE",
        "attributes": [
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_push_sent_count"
          },
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_push_opened_count"
          }
        ]
      }
    ],
    "alias": "push_open_rate"
  }
},
{
  "tenantId": 100173,
  "name": "Push Click Rate",
  "versionTS": 1583969460212,
  "description": "Push Click Rate",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928138,
  "tableId": "MasterCustomer",
  "attributeId": "push_click_rate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CASE",
    "attributes": [
      {
        "atype": ".CriteriaAttribute",
        "criteria": {
          "ctype": ".Criteria",
          "operator": "EQUALS",
          "operands": [
            {
              "ctype": ".FunctionAttribute",
              "type": "CUSTOM",
              "attributes": [
                {
                  "atype": ".ReferenceAttribute",
                  "tableName": "CA_EventCube",
                  "attributeName": "total_push_clicked_count"
                },
                {
                  "atype": ".StaticAttribute",
                  "data": 0
                }
              ],
              "functionName": "COALESCE"
            },
            {
              "ctype": ".StaticAttribute",
              "data": 0
            }
          ]
        }
      },
      {
        "atype": ".StaticAttribute",
        "data": 0
      },
      {
        "atype": ".FunctionAttribute",
        "type": "DIVIDE",
        "attributes": [
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_push_clicked_count"
          },
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_push_clicked_count"
          }
        ]
      }
    ],
    "alias": "push_click_rate"
  }
},
{
  "tenantId": 100173,
  "name": "Open Rate",
  "versionTS": 1583969460315,
  "description": "Open Rate",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928167,
  "tableId": "MasterCustomer",
  "attributeId": "open_rate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CASE",
    "attributes": [
      {
        "atype": ".CriteriaAttribute",
        "criteria": {
          "ctype": ".Criteria",
          "operator": "EQUALS",
          "operands": [
            {
              "ctype": ".FunctionAttribute",
              "type": "CUSTOM",
              "attributes": [
                {
                  "atype": ".ReferenceAttribute",
                  "tableName": "CA_EventCube",
                  "attributeName": "total_sent_count"
                },
                {
                  "atype": ".StaticAttribute",
                  "data": 0
                }
              ],
              "functionName": "COALESCE"
            },
            {
              "ctype": ".StaticAttribute",
              "data": 0
            }
          ]
        }
      },
      {
        "atype": ".StaticAttribute",
        "data": 0
      },
      {
        "atype": ".FunctionAttribute",
        "type": "DIVIDE",
        "attributes": [
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_opened_count"
          },
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_sent_count"
          }
        ]
      }
    ],
    "alias": "open_rate"
  }
},
{
  "tenantId": 100173,
  "name": "Most Popular Response Hour",
  "versionTS": 1581704868424,
  "description": "Most Popular Response Hour",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928195,
  "tableId": "MasterCustomer",
  "attributeId": "most_popular_response_hour",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_EventCube",
    "attributeName": "most_popular_response_hour",
    "alias": "most_popular_response_hour"
  }
},
{
  "tenantId": 100173,
  "name": "Most Popular Response Day",
  "versionTS": 1581704868513,
  "description": "Most Popular Response Day",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928222,
  "tableId": "MasterCustomer",
  "attributeId": "most_popular_response_day",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_EventCube",
    "attributeName": "most_popular_response_day",
    "alias": "most_popular_response_day"
  }
},
{
  "tenantId": 100173,
  "name": "Most Popular Month",
  "versionTS": 1581704868604,
  "description": "Most Popular Month",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190928249,
  "tableId": "MasterCustomer",
  "attributeId": "most_popular_month",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "most_popular_month",
    "alias": "most_popular_month"
  }
},
{
  "tenantId": 100173,
  "name": "Most Popular Hour",
  "versionTS": 1581704868699,
  "description": "Most Popular Hour",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190928276,
  "tableId": "MasterCustomer",
  "attributeId": "most_popular_hour",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "most_popular_hour",
    "alias": "most_popular_hour"
  }
},
{
  "tenantId": 100173,
  "name": "Most Popular Day",
  "versionTS": 1581704868789,
  "description": "Most Popular Day",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190928303,
  "tableId": "MasterCustomer",
  "attributeId": "most_popular_day",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".ReferenceAttribute",
    "tableName": "CA_OrderItemCube",
    "attributeName": "most_popular_day",
    "alias": "most_popular_day"
  }
},
{
  "tenantId": 100173,
  "name": "Months Since Last Purchase",
  "versionTS": 1583969460781,
  "description": "Months Since Last Purchase",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190928330,
  "tableId": "MasterCustomer",
  "attributeId": "months_since_last_purchase",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CUSTOM",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "CUSTOM",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "CUSTOM",
            "attributes": [
              
            ],
            "functionName": "current_date"
          },
          {
            "atype": ".FunctionAttribute",
            "type": "CAST",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "UNIX_TIME",
                "attributes": [
                  {
                    "atype": ".FunctionAttribute",
                    "type": "TIMESTAMP",
                    "attributes": [
                      {
                        "atype": ".FunctionAttribute",
                        "type": "CAST",
                        "attributes": [
                          {
                            "atype": ".ReferenceAttribute",
                            "tableName": "CA_OrderItemCube",
                            "attributeName": "last_purchase_date"
                          },
                          {
                            "atype": ".StaticAttribute",
                            "data": "STRING"
                          }
                        ]
                      },
                      {
                        "atype": ".StaticAttribute",
                        "data": "yyyyMMdd"
                      }
                    ]
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "yyyy-MM-dd"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "DATE"
              }
            ],
            "alias": "last_purchase_date"
          }
        ],
        "functionName": "MONTHS_BETWEEN"
      }
    ],
    "functionName": "FLOOR",
    "alias": "months_since_last_purchase"
  }
},
{
  "tenantId": 100173,
  "name": "Months Since Last Opened Event",
  "versionTS": 1583969460905,
  "description": "Months Since Last Opened Event",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928357,
  "tableId": "MasterCustomer",
  "attributeId": "months_since_last_opened_event",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CUSTOM",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "CUSTOM",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "CUSTOM",
            "attributes": [
              
            ],
            "functionName": "current_date"
          },
          {
            "atype": ".FunctionAttribute",
            "type": "CAST",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "UNIX_TIME",
                "attributes": [
                  {
                    "atype": ".FunctionAttribute",
                    "type": "TIMESTAMP",
                    "attributes": [
                      {
                        "atype": ".FunctionAttribute",
                        "type": "CAST",
                        "attributes": [
                          {
                            "atype": ".ReferenceAttribute",
                            "tableName": "CA_EventCube",
                            "attributeName": "last_opened_eventdate"
                          },
                          {
                            "atype": ".StaticAttribute",
                            "data": "STRING"
                          }
                        ]
                      },
                      {
                        "atype": ".StaticAttribute",
                        "data": "yyyyMMdd"
                      }
                    ]
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "yyyy-MM-dd"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "DATE"
              }
            ],
            "alias": "last_opened_eventdate"
          }
        ],
        "functionName": "MONTHS_BETWEEN"
      }
    ],
    "functionName": "FLOOR",
    "alias": "months_since_last_opened_event"
  }
},
{
  "tenantId": 100173,
  "name": "Months Since Last Delivered Event",
  "versionTS": 1583969461033,
  "description": "Months Since Last Delivered Event",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928384,
  "tableId": "MasterCustomer",
  "attributeId": "months_since_last_delivered_event",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CUSTOM",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "CUSTOM",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "CUSTOM",
            "attributes": [
              
            ],
            "functionName": "current_date"
          },
          {
            "atype": ".FunctionAttribute",
            "type": "CAST",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "UNIX_TIME",
                "attributes": [
                  {
                    "atype": ".FunctionAttribute",
                    "type": "TIMESTAMP",
                    "attributes": [
                      {
                        "atype": ".FunctionAttribute",
                        "type": "CAST",
                        "attributes": [
                          {
                            "atype": ".ReferenceAttribute",
                            "tableName": "CA_EventCube",
                            "attributeName": "last_delivered_eventdate"
                          },
                          {
                            "atype": ".StaticAttribute",
                            "data": "STRING"
                          }
                        ]
                      },
                      {
                        "atype": ".StaticAttribute",
                        "data": "yyyyMMdd"
                      }
                    ]
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "yyyy-MM-dd"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "DATE"
              }
            ],
            "alias": "last_delivered_eventdate"
          }
        ],
        "functionName": "MONTHS_BETWEEN"
      }
    ],
    "functionName": "FLOOR",
    "alias": "months_since_last_delivered_event"
  }
},
{
  "tenantId": 100173,
  "name": "Months Since Last Clicked Event",
  "versionTS": 1583969461155,
  "description": "Months Since Last Clicked Event",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928411,
  "tableId": "MasterCustomer",
  "attributeId": "months_since_last_clicked_event",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CUSTOM",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "CUSTOM",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "CUSTOM",
            "attributes": [
              
            ],
            "functionName": "current_date"
          },
          {
            "atype": ".FunctionAttribute",
            "type": "CAST",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "UNIX_TIME",
                "attributes": [
                  {
                    "atype": ".FunctionAttribute",
                    "type": "TIMESTAMP",
                    "attributes": [
                      {
                        "atype": ".FunctionAttribute",
                        "type": "CAST",
                        "attributes": [
                          {
                            "atype": ".ReferenceAttribute",
                            "tableName": "CA_EventCube",
                            "attributeName": "last_clicked_eventdate"
                          },
                          {
                            "atype": ".StaticAttribute",
                            "data": "STRING"
                          }
                        ]
                      },
                      {
                        "atype": ".StaticAttribute",
                        "data": "yyyyMMdd"
                      }
                    ]
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "yyyy-MM-dd"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "DATE"
              }
            ],
            "alias": "last_clicked_eventdate"
          }
        ],
        "functionName": "MONTHS_BETWEEN"
      }
    ],
    "functionName": "FLOOR",
    "alias": "months_since_last_clicked_event"
  }
},
{
  "tenantId": 100173,
  "name": "Last SMS Opened Event Date",
  "versionTS": 1583969461265,
  "description": "Last SMS Opened Event Date",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928439,
  "tableId": "MasterCustomer",
  "attributeId": "last_sms_opened_eventdate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CAST",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "UNIX_TIME",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "TIMESTAMP",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "CAST",
                "attributes": [
                  {
                    "atype": ".ReferenceAttribute",
                    "tableName": "CA_EventCube",
                    "attributeName": "last_sms_opened_eventdate"
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "STRING"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyyMMdd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "yyyy-MM-dd"
          }
        ]
      },
      {
        "atype": ".StaticAttribute",
        "data": "DATE"
      }
    ],
    "alias": "last_sms_opened_eventdate"
  }
},
{
  "tenantId": 100173,
  "name": "Last Sent Event Date",
  "versionTS": 1583969461374,
  "description": "Last Sent Event Date",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928467,
  "tableId": "MasterCustomer",
  "attributeId": "last_sent_eventdate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CAST",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "UNIX_TIME",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "TIMESTAMP",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "CAST",
                "attributes": [
                  {
                    "atype": ".ReferenceAttribute",
                    "tableName": "CA_EventCube",
                    "attributeName": "last_sent_eventdate"
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "STRING"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyyMMdd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "yyyy-MM-dd"
          }
        ]
      },
      {
        "atype": ".StaticAttribute",
        "data": "DATE"
      }
    ],
    "alias": "last_sent_eventdate"
  }
},
{
  "tenantId": 100173,
  "name": "Last Push Opened Event Date",
  "versionTS": 1583969461486,
  "description": "Last Push Opened Event Date",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928493,
  "tableId": "MasterCustomer",
  "attributeId": "last_push_opened_eventdate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CAST",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "UNIX_TIME",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "TIMESTAMP",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "CAST",
                "attributes": [
                  {
                    "atype": ".ReferenceAttribute",
                    "tableName": "CA_EventCube",
                    "attributeName": "last_push_opened_eventdate"
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "STRING"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyyMMdd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "yyyy-MM-dd"
          }
        ]
      },
      {
        "atype": ".StaticAttribute",
        "data": "DATE"
      }
    ],
    "alias": "last_push_opened_eventdate"
  }
},
{
  "tenantId": 100173,
  "name": "Last Purchase Date",
  "versionTS": 1583969461600,
  "description": "Last Purchase Date",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190928519,
  "tableId": "MasterCustomer",
  "attributeId": "last_purchase_date",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CAST",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "UNIX_TIME",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "TIMESTAMP",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "CAST",
                "attributes": [
                  {
                    "atype": ".ReferenceAttribute",
                    "tableName": "CA_OrderItemCube",
                    "attributeName": "last_purchase_date"
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "STRING"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyyMMdd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "yyyy-MM-dd"
          }
        ]
      },
      {
        "atype": ".StaticAttribute",
        "data": "DATE"
      }
    ],
    "alias": "last_purchase_date"
  }
},
{
  "tenantId": 100173,
  "name": "Last Opened Event Date",
  "versionTS": 1583969461719,
  "description": "Last Opened Event Date",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928545,
  "tableId": "MasterCustomer",
  "attributeId": "last_opened_eventdate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CAST",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "UNIX_TIME",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "TIMESTAMP",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "CAST",
                "attributes": [
                  {
                    "atype": ".ReferenceAttribute",
                    "tableName": "CA_EventCube",
                    "attributeName": "last_opened_eventdate"
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "STRING"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyyMMdd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "yyyy-MM-dd"
          }
        ]
      },
      {
        "atype": ".StaticAttribute",
        "data": "DATE"
      }
    ],
    "alias": "last_opened_eventdate"
  }
},
{
  "tenantId": 100173,
  "name": "Last Email Opened Event Date",
  "versionTS": 1583969461836,
  "description": "Last Email Opened Event Date",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928572,
  "tableId": "MasterCustomer",
  "attributeId": "last_email_opened_eventdate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CAST",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "UNIX_TIME",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "TIMESTAMP",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "CAST",
                "attributes": [
                  {
                    "atype": ".ReferenceAttribute",
                    "tableName": "CA_EventCube",
                    "attributeName": "last_email_opened_eventdate"
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "STRING"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyyMMdd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "yyyy-MM-dd"
          }
        ]
      },
      {
        "atype": ".StaticAttribute",
        "data": "DATE"
      }
    ],
    "alias": "last_email_opened_eventdate"
  }
},
{
  "tenantId": 100173,
  "name": "Last Clicked Event Date",
  "versionTS": 1583969461954,
  "description": "Last Clicked Event Date",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928599,
  "tableId": "MasterCustomer",
  "attributeId": "last_clicked_eventdate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CAST",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "UNIX_TIME",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "TIMESTAMP",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "CAST",
                "attributes": [
                  {
                    "atype": ".ReferenceAttribute",
                    "tableName": "CA_EventCube",
                    "attributeName": "last_clicked_eventdate"
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "STRING"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyyMMdd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "yyyy-MM-dd"
          }
        ]
      },
      {
        "atype": ".StaticAttribute",
        "data": "DATE"
      }
    ],
    "alias": "last_clicked_eventdate"
  }
},
{
  "tenantId": 100173,
  "name": "Last Bounced Event Date",
  "versionTS": 1583969462062,
  "description": "Last Bounced Event Date",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928625,
  "tableId": "MasterCustomer",
  "attributeId": "last_bounced_eventdate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CAST",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "UNIX_TIME",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "TIMESTAMP",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "CAST",
                "attributes": [
                  {
                    "atype": ".ReferenceAttribute",
                    "tableName": "CA_EventCube",
                    "attributeName": "last_bounced_eventdate"
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "STRING"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyyMMdd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "yyyy-MM-dd"
          }
        ]
      },
      {
        "atype": ".StaticAttribute",
        "data": "DATE"
      }
    ],
    "alias": "last_bounced_eventdate"
  }
},
{
  "tenantId": 100173,
  "name": "First Purchase Date",
  "versionTS": 1583969462164,
  "description": "First Purchase Date",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190928651,
  "tableId": "MasterCustomer",
  "attributeId": "first_purchase_date",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CAST",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "UNIX_TIME",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "TIMESTAMP",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "CAST",
                "attributes": [
                  {
                    "atype": ".ReferenceAttribute",
                    "tableName": "CA_OrderItemCube",
                    "attributeName": "first_purchase_date"
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "STRING"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyyMMdd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "yyyy-MM-dd"
          }
        ]
      },
      {
        "atype": ".StaticAttribute",
        "data": "DATE"
      }
    ],
    "alias": "first_purchase_date"
  }
},
{
  "tenantId": 100173,
  "name": "Email Open Rate",
  "versionTS": 1583969462266,
  "description": "Email Open Rate",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928678,
  "tableId": "MasterCustomer",
  "attributeId": "email_open_rate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CASE",
    "attributes": [
      {
        "atype": ".CriteriaAttribute",
        "criteria": {
          "ctype": ".Criteria",
          "operator": "EQUALS",
          "operands": [
            {
              "ctype": ".FunctionAttribute",
              "type": "CUSTOM",
              "attributes": [
                {
                  "atype": ".ReferenceAttribute",
                  "tableName": "CA_EventCube",
                  "attributeName": "total_email_sent_count"
                },
                {
                  "atype": ".StaticAttribute",
                  "data": 0
                }
              ],
              "functionName": "COALESCE"
            },
            {
              "ctype": ".StaticAttribute",
              "data": 0
            }
          ]
        }
      },
      {
        "atype": ".StaticAttribute",
        "data": 0
      },
      {
        "atype": ".FunctionAttribute",
        "type": "DIVIDE",
        "attributes": [
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_email_opened_count"
          },
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_email_sent_count"
          }
        ]
      }
    ],
    "alias": "email_open_rate"
  }
},
{
  "tenantId": 100173,
  "name": "Email Click Rate",
  "versionTS": 1583969462368,
  "description": "Email Click Rate",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928705,
  "tableId": "MasterCustomer",
  "attributeId": "email_click_rate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CASE",
    "attributes": [
      {
        "atype": ".CriteriaAttribute",
        "criteria": {
          "ctype": ".Criteria",
          "operator": "EQUALS",
          "operands": [
            {
              "ctype": ".FunctionAttribute",
              "type": "CUSTOM",
              "attributes": [
                {
                  "atype": ".ReferenceAttribute",
                  "tableName": "CA_EventCube",
                  "attributeName": "total_email_sent_count"
                },
                {
                  "atype": ".StaticAttribute",
                  "data": 0
                }
              ],
              "functionName": "COALESCE"
            },
            {
              "ctype": ".StaticAttribute",
              "data": 0
            }
          ]
        }
      },
      {
        "atype": ".StaticAttribute",
        "data": 0
      },
      {
        "atype": ".FunctionAttribute",
        "type": "DIVIDE",
        "attributes": [
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_email_clicked_count"
          },
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_email_sent_count"
          }
        ]
      }
    ],
    "alias": "email_click_rate"
  }
},
{
  "tenantId": 100173,
  "name": "Days Since Last Sent Event",
  "versionTS": 1583969462512,
  "description": "Days Since Last Sent Event",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928736,
  "tableId": "MasterCustomer",
  "attributeId": "days_since_last_sent_event",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CUSTOM",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "CUSTOM",
        "attributes": [
          
        ],
        "functionName": "current_date"
      },
      {
        "atype": ".FunctionAttribute",
        "type": "CAST",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "UNIX_TIME",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "TIMESTAMP",
                "attributes": [
                  {
                    "atype": ".FunctionAttribute",
                    "type": "CAST",
                    "attributes": [
                      {
                        "atype": ".ReferenceAttribute",
                        "tableName": "CA_EventCube",
                        "attributeName": "last_sent_eventdate"
                      },
                      {
                        "atype": ".StaticAttribute",
                        "data": "STRING"
                      }
                    ]
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "yyyyMMdd"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyy-MM-dd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "DATE"
          }
        ],
        "alias": "last_sent_eventdate"
      }
    ],
    "functionName": "DATEDIFF",
    "alias": "days_since_last_sent_event"
  }
},
{
  "tenantId": 100173,
  "name": "Days Since Last Purchase",
  "versionTS": 1583969462659,
  "description": "Days Since Last Purchase",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190928766,
  "tableId": "MasterCustomer",
  "attributeId": "days_since_last_purchase",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CUSTOM",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "CUSTOM",
        "attributes": [
          
        ],
        "functionName": "current_date"
      },
      {
        "atype": ".FunctionAttribute",
        "type": "CAST",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "UNIX_TIME",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "TIMESTAMP",
                "attributes": [
                  {
                    "atype": ".FunctionAttribute",
                    "type": "CAST",
                    "attributes": [
                      {
                        "atype": ".ReferenceAttribute",
                        "tableName": "CA_OrderItemCube",
                        "attributeName": "last_purchase_date"
                      },
                      {
                        "atype": ".StaticAttribute",
                        "data": "STRING"
                      }
                    ]
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "yyyyMMdd"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyy-MM-dd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "DATE"
          }
        ],
        "alias": "last_purchase_date"
      }
    ],
    "functionName": "DATEDIFF",
    "alias": "days_since_last_purchase"
  }
},
{
  "tenantId": 100173,
  "name": "Days Since Last Opened Event",
  "versionTS": 1583969462787,
  "description": "Days Since Last Opened Event",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928796,
  "tableId": "MasterCustomer",
  "attributeId": "days_since_last_opened_event",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CUSTOM",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "CUSTOM",
        "attributes": [
          
        ],
        "functionName": "current_date"
      },
      {
        "atype": ".FunctionAttribute",
        "type": "CAST",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "UNIX_TIME",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "TIMESTAMP",
                "attributes": [
                  {
                    "atype": ".FunctionAttribute",
                    "type": "CAST",
                    "attributes": [
                      {
                        "atype": ".ReferenceAttribute",
                        "tableName": "CA_EventCube",
                        "attributeName": "last_opened_eventdate"
                      },
                      {
                        "atype": ".StaticAttribute",
                        "data": "STRING"
                      }
                    ]
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "yyyyMMdd"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyy-MM-dd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "DATE"
          }
        ],
        "alias": "last_opened_eventdate"
      }
    ],
    "functionName": "DATEDIFF",
    "alias": "days_since_last_opened_event"
  }
},
{
  "tenantId": 100173,
  "name": "Days Since Last Clicked Event",
  "versionTS": 1583969462912,
  "description": "Days Since Last Clicked Event",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928825,
  "tableId": "MasterCustomer",
  "attributeId": "days_since_last_clicked_event",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CUSTOM",
    "attributes": [
      {
        "atype": ".FunctionAttribute",
        "type": "CUSTOM",
        "attributes": [
          
        ],
        "functionName": "current_date"
      },
      {
        "atype": ".FunctionAttribute",
        "type": "CAST",
        "attributes": [
          {
            "atype": ".FunctionAttribute",
            "type": "UNIX_TIME",
            "attributes": [
              {
                "atype": ".FunctionAttribute",
                "type": "TIMESTAMP",
                "attributes": [
                  {
                    "atype": ".FunctionAttribute",
                    "type": "CAST",
                    "attributes": [
                      {
                        "atype": ".ReferenceAttribute",
                        "tableName": "CA_EventCube",
                        "attributeName": "last_clicked_eventdate"
                      },
                      {
                        "atype": ".StaticAttribute",
                        "data": "STRING"
                      }
                    ]
                  },
                  {
                    "atype": ".StaticAttribute",
                    "data": "yyyyMMdd"
                  }
                ]
              },
              {
                "atype": ".StaticAttribute",
                "data": "yyyy-MM-dd"
              }
            ]
          },
          {
            "atype": ".StaticAttribute",
            "data": "DATE"
          }
        ],
        "alias": "last_clicked_eventdate"
      }
    ],
    "functionName": "DATEDIFF",
    "alias": "days_since_last_clicked_event"
  }
},
{
  "tenantId": 100173,
  "name": "Click Rate",
  "versionTS": 1583969463032,
  "description": "Click Rate",
  "active": false,
  "lastModifiedBy": "system",
  "createdTS": 1562190928852,
  "tableId": "MasterCustomer",
  "attributeId": "click_rate",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_EventCube",
    "modelId": "CA_EventModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CASE",
    "attributes": [
      {
        "atype": ".CriteriaAttribute",
        "criteria": {
          "ctype": ".Criteria",
          "operator": "EQUALS",
          "operands": [
            {
              "ctype": ".FunctionAttribute",
              "type": "CUSTOM",
              "attributes": [
                {
                  "atype": ".ReferenceAttribute",
                  "tableName": "CA_EventCube",
                  "attributeName": "total_sent_count"
                },
                {
                  "atype": ".StaticAttribute",
                  "data": 0
                }
              ],
              "functionName": "COALESCE"
            },
            {
              "ctype": ".StaticAttribute",
              "data": 0
            }
          ]
        }
      },
      {
        "atype": ".StaticAttribute",
        "data": 0
      },
      {
        "atype": ".FunctionAttribute",
        "type": "DIVIDE",
        "attributes": [
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_clicked_count"
          },
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_EventCube",
            "attributeName": "total_sent_count"
          }
        ]
      }
    ],
    "alias": "click_rate"
  }
},
{
  "tenantId": 100173,
  "name": "Average Order Value",
  "versionTS": 1594249169878,
  "description": "AOV",
  "active": true,
  "lastModifiedBy": "system",
  "createdTS": 1562190928880,
  "tableId": "MasterCustomer",
  "attributeId": "AOV",
  "dataSource": {
    "type": "cube",
    "cubeId": "CA_OrderItemCube",
    "modelId": "CA_OrderItemModel"
  },
  "expression": {
    "atype": ".FunctionAttribute",
    "type": "CASE",
    "attributes": [
      {
        "atype": ".CriteriaAttribute",
        "criteria": {
          "ctype": ".Criteria",
          "operator": "EQUALS",
          "operands": [
            {
              "ctype": ".FunctionAttribute",
              "type": "CUSTOM",
              "attributes": [
                {
                  "atype": ".ReferenceAttribute",
                  "tableName": "CA_OrderItemCube",
                  "attributeName": "total_purchase_count"
                },
                {
                  "atype": ".StaticAttribute",
                  "data": 0
                }
              ],
              "functionName": "COALESCE"
            },
            {
              "ctype": ".StaticAttribute",
              "data": 0
            }
          ]
        }
      },
      {
        "atype": ".StaticAttribute",
        "data": 0
      },
      {
        "atype": ".FunctionAttribute",
        "type": "DIVIDE",
        "attributes": [
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_OrderItemCube",
            "attributeName": "total_spent_amt"
          },
          {
            "atype": ".ReferenceAttribute",
            "tableName": "CA_OrderItemCube",
            "attributeName": "total_purchase_count"
          }
        ]
      }
    ],
    "alias": "AOV"
  }
}

Learn more

Intelligent attributes API

Master entities API