Forum Discussion

PowerBWhy's avatar
PowerBWhy
Frequent Visitor
6 years ago

SAP BW BEx Value is not a cube

This technique was taught to me by someone I unfortunately no longer have access to. I can't get it to function properly and haven't found any answers searching around.

 

I am importing data through a SAP Business Warehouse Message Server and selecting a parameter for an arbitrary set of weeks. I also have a date table which I am dynamically filtering with date fucntions to get a list of the previous 5 weeks. From that filtered table I am creating a custom text column to match the format of how the date appears in the sap parameter. I am then taking that custom column and adding it as a new query titled "List."  I am then wrapping that query formula in {} to convert it to a list. Finally, I am replacing the sap date paramenter with List{0}} but I am getting an "Expression.Error: The value is not a cube. Details:[Table]". To verify that my custom text column is functioning correctly I have copied a single value from the list and pasted it in the parameter and it works.

 

What could be causing this issue? Am I properly using the list? Sorry if there are gaps in my description. I am fairly new to using PowerBi and SAP.

 

Thank you.

7 Replies

  • Stachu's avatar
    Stachu
    Community Champion

    can you share your M code for this query (you can get it from Advanced Editor in the Edit Queries Home tab
    it could be multiple things, e.g.

    1) you pass a text instead of reference to cube value

    2) one of the values in the list is not valid and is causing an error (although it would have to be the first entry as you use List{0})

    3) wrong syntax
    anyway to determine what it is I need to see the code you are using

     

    also have a read here
    https://community.powerbi.com/t5/Desktop/Dynamic-Parameters-with-SAP-BW-BEX/m-p/623453

    https://community.powerbi.com/t5/Desktop/SAP-BW-BEx-Dynamic-Parameters/m-p/464624

    • PowerBWhy's avatar
      PowerBWhy
      Frequent Visitor

      Stachu  Thanks for the reply, here are my code screenshots:

      This is the code as it comes ffrom BEx editor before manually making any changes

       

      Here is the code creating the list that I am attempting to pass through the SAP parameter. Along with an image showing the formatting of the values before converting to a list:

       

      Finally an image when I attempt to pass the list through the SAP parameter:

       

      Thank you.

      • Stachu's avatar
        Stachu
        Community Champion

        List{0} is giving a text - first value in the list, not the whole list

        try this:

        {Cube.ApplyParameter, "!V000011]",{List}}

        assuming I didn't made any typos copying syntax from your screenshot it should work - for the future it's much better to post as text rather than image 

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      @Stachu  Thanks for the reply, here are my code screenshots:

      This is the code as it comes ffrom BEx editor before manually making any changes

       

      CreditError1.PNG

      Here is the code creating the list that I am attempting to pass through the SAP parameter. Along with an image showing the formatting of the values before converting to a list:

      CreditError3.PNGCreditError4.PNG

       

      Finally an image when I attempt to pass the list through the SAP parameter:

      CreditError2.PNG

       

      Thank you.