Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

How to get difference of summaries at the dimension level?

33 views
Skip to first unread message

Guruprasad Paduthonse

unread,
Aug 8, 2016, 1:44:57 AM8/8/16
to Cubes
Hi,

I need to know if I can use expression to find out difference of summaries at the dimension level?

Eg: I need to know difference of amounts for January and February 

Below is my model. In the model below I would like to know difference of "basiccost_sum" between two months say January and February

{
    "dimensions": [
           {"name":"grinmodified",
  "levels": [
{
"name":"category_name",
"label":"Category name",
"attributes": ["category_name"]
},
{
"name":"country",
"label": "Country",
"attributes":["country"]
},
  {
"name":"item",
"label":"Item",
"attributes": ["item"]
},
  {"name":"month",
"label":"Month",
"attributes":["month"]
  }
  ],
  "hierarchies": [
{
"name":"category_hierarchy",
"label":"Category wise",
"levels":["category_name","item"]
},
{
"name":"country_hierarchy",
"label":"Country wise",
"levels":["item","country"]
},
{
"name":"month_heirarchy",
"label":"Month wise",
"levels":["month","item"]
}
  
  ]
  }
  
 
    ],
    "cubes": [
        {
"name": "grinmodified",
            "dimensions": ["grinmodified"],
            "measures": [
                {"name":"quantity", "label":"Quantity"},
{"name":"landed_cost_inr", "label":"Landed Cost"},
{"name":"basic_cost_inr", "label":"Basic Cost"},
{"name":"tax_inr", "label":"Tax"}
            ],
            "aggregates": [
                    {
                        "name": "quantity_sum",
                        "function": "sum",
                        "measure": "quantity"
                    },
{
                        "name": "lc_sum",
                        "function": "sum",
                        "measure": "landed_cost_inr"
                    },
{
                        "name": "basiccost_sum",
                        "function": "sum",
                        "measure": "basic_cost_inr"
                    },
{
                        "name": "tax_sum",
                        "function": "sum",
                        "measure": "tax_inr"
                    },
{"name":"unit_basic_cost",
"expression": "basiccost_sum / quantity_sum"
},
{"name":"unit_tax_cost",
"expression": "tax_sum / quantity_sum"
},
{"name":"unit_landed_cost",
"expression": "lc_sum / quantity_sum"
}


                ]
        }
    ]
}

Reply all
Reply to author
Forward
0 new messages