CUBEMEMBER Solution Needed - showing a result that's not in the data

deharris

New Member
Joined
Dec 15, 2017
Messages
19
I'm working on a CUBEMEMBER string and it always returns me the last value regardless of whether that value is in the table or not. here's the actual text.

=CUBEMEMBER("ThisWorkbookDataModel",{"[Program Entry].[PROGRAM KEY].&[PROGRAM KEY DESCRIPTION]","[Program Entry].[PLANNER TYPE].&[PLANNER]"})

I'm trying to use the formula to return if the CUBEMEMBER says "PLANNER", "OPTIONAL" or blank (which would be an error message) if it doesn't find the string array shown here. When I change the final &[PLANNER] to [OPTIONAL], the formula result is OPTIONAL even though that result isn't in the data itself.

thoughts on how to solve?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Do you need to be using CUBEVALUE here? Are you trying to return a scalar value or a data set?

Maybe if you can give a sample of the data you're looking to return...
 
Upvote 0
Thank you for the reply @macfuller. I'm trying to return a text value. I have a list of 'planner' items and the Planner Type will be "PLANNER," "OPTIONAL," or "BLANK" depending on the data entry for the specific planner item. I tried inserting a photo but it wouldn't go through with the URL (that I can tell) so I'm pasting it below. I'm trying to solve for a cube formula that tells me the PLANNER TYPE if I solve for Customer, Program Item, Customer Subgroup and Planner Date

CUSTOMERPROGRAM ITEMCUSTOMER SUBGROUPPLANNER DATEPLANNER TYPE
CUSTOMER 1ITEM 1CUSTOMER SUBGROUP 1DECEMBER - 2017PLANNER
CUSTOMER 1ITEM 1CUSTOMER SUBGROUP 2DECEMBER - 2017OPTIONAL
CUSTOMER 1ITEM 1CUSTOMER SUBGROUP 3DECEMBER - 2017OPTIONAL
CUSTOMER 1ITEM 2CUSTOMER SUBGROUP 1DECEMBER - 2017PLANNER
CUSTOMER 1ITEM 2CUSTOMER SUBGROUP 2DECEMBER - 2017
CUSTOMER 1ITEM 2CUSTOMER SUBGROUP 3DECEMBER - 2017
CUSTOMER 1ITEM 3CUSTOMER SUBGROUP 1DECEMBER - 2017PLANNER
CUSTOMER 1ITEM 3CUSTOMER SUBGROUP 2DECEMBER - 2017OPTIONAL
CUSTOMER 1ITEM 3CUSTOMER SUBGROUP 3DECEMBER - 2017OPTIONAL

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>


REPORT%20EX.emf
REPORT%20EX.emf
 
Upvote 0
Try using this formulation... assuming your table name is "MyTable"...

=CUBERANKEDMEMBER("ThisWorkbookDataModel",CUBESET("ThisWorkbookDataModel",
"([MyTable].[Customer].[Customer 1],
Do the same for your other selection fields...
[MyTable].[Planner Type].children)"),1)

If you're using slicers to select each filter value, put a CUBERANKEDMEMBER statement into a cell to return the value of each selected slicer and use the [MyTable].[Selected Field].[" & $B$3 & "]" format.
 
Upvote 0
thank you for the insight. i've had to rework my data and I built the formula as close as I could to your recommendation but I'm getting #N/A.

=CUBERANKEDMEMBER("ThisWorkbookDataModel",CUBESET("ThisWorkbookDataModel",{"[Table 1].[Table 1 Column 1].&[Table 1 Column 1 Value]","[Table 2].[Table 2 Column 1].&[Table 2 Column 1 Value]","[Table 2].[Table 2 Column 2].&[Table 2 Column 2 Value]","[Table 3].[Table 3 Column 1].&[Table 3 Column 1 Value]","[Table 4].[Table 4 Column 1].CHILDREN"}),1)

I'm trying to solve for the text value of the value of Table 4 Column 1 if all the other values are found. It all works in PowerPivot and a can convert all of this in pivot tables to formulas so I'm sure I'm just missing some syntax somewhere. Thank you for any further insight.
 
Upvote 0
I'm not sure if you're offering your actual syntax, but the structure is
.[Column].[Value]. You don't repeat the table value for the other fields. You also don't need the curly brackets for the 2nd CUBESET parameter - it's one long string. I'm not sure if it matters but they would be inside the quote marks if you did use them. I'm also not sure if .children needs to be lower case but it works that way for me.
 
Upvote 0
Your notes have enabled progress! The formula is now too long for one cell (exceeds character limits) so I tried a concatenate in the data itself. You were correct about the syntax not being exactly as shown with the [Table # Column #] reference, I was simply being too descriptive. I've shortened the formula to this (below) and the answer it returns is the text of the Program Key Value as opposed to the text of [Table 2].[Column 2].children. The [Table 2].[Column 2].children text is the variable that could be blank, "planner' or "optional." Your help has brought it closer. Any other advice?

=CUBERANKEDMEMBER("ThisWorkbookDataModel",CUBESET("ThisWorkbookDataModel","[Table 1].[Column 1].&[Program Key Value]","[Table 2].[Column 2].children"),1)
 
Upvote 0
CUBESET has only the one set expression parameter after the workbook data model. The way you've written it has [Table 2].[Column 2].children as the caption parameter. Everything in the set expression variable is a single string.
 
Upvote 0

Forum statistics

Threads
1,214,896
Messages
6,122,132
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top