Using objects that are named the same inside a Metric/Dossier/Report.
vladbalcanu opened this issue · 5 comments
Inside the workstation you can pick the objects you want to use inside a Metric/Dossier/Report. That being said if you have 2 attributes named the same lets say: City, as long as you put them in separate folders you can do it. Then if you want to use one or the other inside a metric or report or dossier, you just need to pick which one. If i want to create a metric: CityMetric, that uses one of the attributes, the formula stays the same whichever i pick to use. My question is, how can i decide what attribute to use when creating a Metric with the Python API? From what i know, an error is returned usually when trying to use an attribute like this saying: More than one match returned for City
.
@vladbalcanu : I can follow you. I didn't do a deep dive, but you should check the REST API directly. Pls. go to your swagger page and check the following endpoint. yourserver/MicroStrategyLibrary/api-docs/index.html#/Reports/ms-getReport
Here you might find something.
Okey but i would like to know how to do it from the MicroStrategy API directly if is possible and firstly inside a metric. I did check out the Metric endpoints and they require an expression (as I said in the expression, the object's name is used. if the name is the same but it manages to get the right object then maybe there is another workflow or API endpoint that is not exposed).
@vladbalcanu : Sorry for my last answer. This answer was for your other question how to address individual join types between certain metrics.
I was able to create a metri using the following statement:
{ "information": {
"name": "New Metric1",
"destinationFolderId": "5C6A68174DC3E55B31C80EB653259E0E",
"subType": "metric"
},
"expression": {
"tokens": [
{
"value": "&Sum(Cost){~+}"
} ] }}
That you need to use the name and not the ID seems to be correct. I tried to specify it closer by including the folder pass, but without success (however, I expect this is doable somehow). My first idea to fix this was, to rename fact cost, putting a unique pre or post fix, save the metric and rename the org object afterwards. Not nice, but..
hope it helps,
Daniel
Yes, Using different names works. I was interested in a way to do specify the ID of the object instead maybe or the Alias. Was looking for having 2 attributes named the same but used differently. Thank you for your support.
I think we should lock an EH with MSTR Support, since this is a REST API issue and not an mstrio-py issue.