Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Query
  2. {
  3.     "from": 0,
  4.     "size": 15,
  5.     "sort": {},
  6.     "type": "leftJoin",
  7.     "by": [
  8.         {
  9.             "events": "brand"
  10.         },
  11.         {
  12.             "events": "currency"
  13.         }
  14.     ],
  15.     "queries": [
  16.         {
  17.             "aggregations": [
  18.                 {
  19.                     "dimension": {
  20.                         "alias": "brand",
  21.                         "field": "attributes.brand.string"
  22.                     },
  23.                     "aggregation": {
  24.                         "type": "category"
  25.                     }
  26.                 },
  27.                 {
  28.                     "dimension": {
  29.                         "alias": "currency",
  30.                         "field": "attributes.currency.string"
  31.                     },
  32.                     "aggregation": {
  33.                         "type": "category"
  34.                     }
  35.                 },
  36.                 {
  37.                     "alias": "fc",
  38.                     "dimension": {
  39.                         "cubeId": "financial_transactions",
  40.                         "field": "type"
  41.                     },
  42.                     "aggregation": {
  43.                         "type": "category"
  44.                     }
  45.                 }
  46.             ],
  47.             "measures": [
  48.                 {
  49.                     "type": "children",
  50.                     "agg_id": "fc",
  51.                     "operation": "count",
  52.                     "dimension": {
  53.                         "cubeId": "financial_transactions",
  54.                         "field": "amount.amount"
  55.                     }
  56.                 }
  57.             ],
  58.             "filters": [
  59.                 {
  60.                     "operation": "in",
  61.                     "dimension": {
  62.                         "cubeId": "events",
  63.                         "field": "attributes.brand.string"
  64.                     },
  65.                     "value": [
  66.                         "brand1",
  67.                         "brand2",
  68.                         "ASIANTRIALUSD"
  69.                     ]
  70.                 }
  71.             ],
  72.             "flatResults": true,
  73.             "type": "sliceAndDice",
  74.             "cube": "events"
  75.         }
  76.     ]
  77. }
  78. // Response
  79. {
  80.     "series": [
  81.         {
  82.             "brand": "brand2",
  83.             "currency": "USD",
  84.             "fc.DEPOSIT": 96,
  85.             "fc.WITHDRAW_DIRECT": 96
  86.         },
  87.         {
  88.             "brand": "brand1",
  89.             "currency": "USD",
  90.             "fc.DEPOSIT": 48,
  91.             "fc.WITHDRAW_DIRECT": 48
  92.         }
  93.     ],
  94.     "meta": {
  95.         "total": 2,
  96.         "from": 0,
  97.         "size": 2
  98.     }
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement