Hopefully someone can help me with the following.
In Excel, I want to retrieve column names from a certain dimension table, similarly to how you can retrieve members using the CUBESET function.
When I use CUBESET to retrieve members, the formula looks like this:
=CUBESET("Data","[DimCustomer].[CustomerName].children","Cubeset CustomerName")
I'm looking for a way to retrieve the columns, like CustomerName, from the dimension table. I was hoping something like this would work:
=CUBESET("Data","[DimCustomer].children","Cubeset DimCustomer fields")
However, this is not the case. Is this possible and does anyone know how I can achieve this?
Thanks in advance.
Related
I'm new to cube functions but they've been incredibly helpful so far in a recent project. I'm currently trying to extract an ordered list of every unique integer value in the field "CYQ" from Excel's data model. Everything I try returns a blank list.
My intended formula was:
=CUBESET("ThisWorkbookDataModel", "[IND_TABLE].[CYQ].children","ALL",1,"[IND_TABLE].[CYQ]")
which I believed would pull the field CYQ from the table IND_TABLE, the only only table in my model, and sort it by CYQ. Currently it only returns the word "ALL" in the cell and nothing else.
Any insight or advice would be great, thanks you. Funny enough, searching online has only brought up help for constructing more complicated cubeset formulas, but I can't find help for one this simple.
CUBESET on its own does not return the values to the worksheet; for that, you need to query the return from CUBESET using CUBERANKEDMEMBER. Properly coerced, you can return an array of values with a single formula, for example:
=LET(ζ,CUBESET("ThisWorkbookDataModel","[IND_TABLE].[CYQ].Children"),CUBERANKEDMEMBER("ThisWorkbookDataModel",ζ,SEQUENCE(CUBESETCOUNT(ζ))))
Edit: I see that you've tagged Excel 2010, in which case you won't be able to return all values using a single formula; instead, you'll need something like:
=IF(ROWS(A$1:A1)>CUBESETCOUNT(CUBESET("ThisWorkbookDataModel","[IND_TABLE].[CYQ].Children")),"",CUBERANKEDMEMBER("ThisWorkbookDataModel",CUBESET("ThisWorkbookDataModel","[IND_TABLE].[CYQ].Children"),ROWS(A$1:A1)))
and then copied down until you start to get blanks for the results.
Basically I have a table like this:
The Names are filtered from another table and are dynamic.
I am trying to sum the values based on two criteria ("Duration" and "Day of week"), like this:
=SUMIFS($B5:$E5,$B$2:$E$2,G$2,$B$3:$E$3,G$3)
This gives a correct result, but I want the formula to dynamically update, based on the dynamic formula that contains the names. So I tried this:
=IF(A5#<>0,SUMIFS($B5:$E5,$B$2:$E$2,G$2,$B$3:$E$3,G$3),0)
This goes way down the table, but it always returns the sum of the first row.
Is anyone aware of a solution to this?
Just posting an answer so I can include a screenshot - illustrating that the formula
=SUM(INDEX($A$5#,,MATCH(G2&G3,$A$2:$E$2&$A$3:$E$3,0)))
does produce a valid result
I'm trying to find the code for the best match in a table using 4 lookup values.
In the image below the left table A to E is a static table and is the reference table
The right table normally on a separate sheet has multiple lines of varying data, where I need to find the correct code based matching the Name, Age and Age Calc from, using the information in the reference table.
I have tried VLOOKUP and INDEX/MATCH, but I'm struggling with the multiple lookup values.
The answers I need in J are: 5678, 7654, 4679, 7654, 1234.
What would be my best method of achieving my code results?
You can do this with a SUMIFS:
=SUMIFS(E:E,A:A,G2,B:B,"<="&H2,C:C,">="&H2,D:D,I2)
Assuming there can be only one match, then do something like:
=SUMIFS($E$2:$E$6,$A$2:$A$6,G2,$B$2:$B$6,"<="&H2,$C$2:$C$6,">="&H2,$D$2:$D$6,I2)
This is the formula that worked for me.
=INDEX(E:E,AGGREGATE(15,6,ROW(E$2:E$6)/(A$2:A$6=G2)/(B$2:B$6<=H2)/(C$2:C$6>=H2)/(D$2:D$6=I2),1))
I am making an excel sheet where I have multiple tables with different values, and each table has a list of items, differing each one from another. The problem is that I use multiple tables, therefore I cant use the method =ROWS($A$1:A1), because sometimes the starting index will be in another cell, get me?
If someone can help me it would be really nice!
Thanks!
Example of what I have
Sounds like you want to add row numbering which you can do using structured referencing.
You can use formula
=ROW(Table1[#]) -ROW(Table1[[#Headers],[columnName]])
Adjust Table name and columnName for where inserting.
I'm convinced this has to be something very straightforward - I just couldn't find any stack exchange posts referencing it. I apologize if it's already out there.
I'm trying to filter out a couple of numbers from a long list that I have in an excel table. Something similar to an 'in' clause in SQL, but I'm not using a formula - just trying to use the table functionality in Excel 2010. Any help appreciated on how to input multiple numbers/id's at once.
The closest I've found so far is using advanced filters as suggested here - but it's not quite as simple as keying something into the search bar:
https://superuser.com/questions/623380/excel-filter-a-column-by-more-than-two-values
Thanks
The short answer is no, not really. Within Excel, you can filter with two conditions (via an or), but to my knowledge you can't do more than two.
If you are interested in a hack, here is one.
Create a second table with a list of values you want to filter. Make sure it's a table, not a range, for scalability
Create a new field in your original table, and vlookup your value against the new table. Something like this:
.
=IF(ISNA(VLOOKUP([#UID],NewTable[[#All],[FilterItems]],1,FALSE)),"","Y")
Now your original table will have a field you can filter on "Y" to get items in your list.
And because you made it a table, not a range, if you add items, the vlookup will dynamically scale to include those new items, without you having to do the cursed A:A range.
Home Tab > Highlight Column of values > Sort & Filter button > Filter > and from the excel sheet you can filter it by number from the top of the column of values.