Aug 01 2020 08:41 AM
I would like to see an example of MDX script in Excel to use use the function "SapHanaRangeOperator.Equals".
I have established a connection to an SAP HANA database using power query in excel 2016 using the function: SapHana.Database. Using this connection, i can access data of the type "cube", by adding dimensions and attributes. If the data type is "parameterized cube" i get an error message when i try to add dimensions and attributes. I think this is because the SAP hana server needs to be told a date range (input parameters) in order to actually provide the data from the "parameterized cube" data kind. There message i get says that i lack permissions, but i know this is not the case because i can access the data through other applications, such as "SAP analysis for office".
Here is an example of the script i am using to successfully get data out of the HANA database using power query on a "non-parameterized" cube. What i want to know is an example of how to add the "SapHanaRangeOperator.Equals" or other such function, if the cube "YYYY" were to a "parameterize" cube.
let
Source = SapHana.Database("<Server:port>"),
Contents = Source{[Name="Contents"]}[Data],
#"<ZZZZ>" = Contents{[Name="<ZZZZ>"]}[Data],
<YYYY> = #"<ZZZZ>"{[Name="<YYYY>"]}[Data],
#"Added Items" = Cube.Transform(<YYYY>,
{
{Cube.AddAndExpandDimensionColumn, "AGREE_DATE", {"AGREE_DATE"}, {"AGREE_DATE"}},
{Cube.AddMeasureColumn, "VOLUME", "VOLUME"}
})
in
#"Added Items"