I want to get data from cube based on passed number of customer ids through Web API (C#). As i have search there is no clue to fetch data using IN operator like IN in T-Sql but how can we do in MDX query?. I can filter with single value using instr
.
would you provide any suggestion how to perform this? May i do for loop and query for single value, store and return, but it will be heavy query or every Single value?
In operator can be implement in MDX quite easily. Let say I want to list data for 2011,2012, 2013 . The implementaion will be as follows.
{[Date].[Calendar Year].[CY 2011],[Date].[Calendar Year].[CY 2012],[Date].[Calendar Year].[CY 2013]}
Here the brackets indicate that there is a set referred"{}".
Based on the last comment. So lets say you get three id 100,200,300 and you want to have implement IN them.
{[Customers].[Customer].[100],[Customers].[Customer].[200],[Customers].[Customer].[300]}
may i do this way HAVING instr(1,[Customers].[Customer].currentmember.name, "(000045)") OR instr(1,[Customers].[Customer].currentmember.name, "(000322)") ON ROWS
What is your business senario.
I want to get customer ids from Web API request and build query based on passed customer ids and return the result
Does the above help?
yes, it helps but the reason I was using instr because some of the members have space in them. For example, " (000045)". Is there any other way to retrieve the data apart from using instr?