Which is the most flexible way for end-user to create a report querying an SSAS Cube? - excel-formula

I know that you can query a cube by connecting from Excel to Analysis database and using formulas like cubevalue() or cubemember().
I also know that after converting the power pivot to formulas, you can access the attribute and the value related only by writing a text.
Example: for Branch Dimension, instead of writing
cubemember("connections";"[DimBranch].[Name].[All].[London])" )
you can write in the cell only "London". However, this won't work if you have a parent-child dimension and want to retrieve the amount for one of the intermediate levels.
Did anyone know about how can you avoid writing these formulas directly by the end-user ?

I´ve done this several times. I can describe the approach I´ve used in the past.
You need to define the input from the user, for example Fiscal Year, Fiscal Period,... and create a tab with a friendly layout for this solely purpose.
After that you create your pivot/pivots against the cube/s you want to query with the data extraction that you need (obiously these pivots will refer to the Fiscal Year and Period). Define the desired layout for these pivots (as you want them you be shown). Once You´ve done this, you need to convert into formulas these pivots, including parameters. You´ll see that values placed in the measure box contain a formula cubevalue which makes reference to the connection itself and several cubemembers. It makes reference to the measure as well.
The trickiest part comes now, when you need to modify your cubemember function to take value from the input, something like cubemember("connections";"[DimBranch].[Name].[All].["+MyReferenceCell+")" ), and you have your dimension picked up from a value entered by a user.
If you have as a matter of fact, serveral pivots referencing common dimensions, you need to make the reference this modified cubemember cell affected by user input, otherwise you have to modify all affected cubemembers in your pivots converted to formulas.
This has a really good advantage: depending on the excel´s version, all pivots are automatically recalulated if you change the value in the user´s input cell without hitting the refresh all button.
On the other hand, the disadvantage comes when your report in excel contains a list of values from a dimension which can grow. After converting pivots into formulas those new values for the dimension are lost. That´s why you can always place a control if you have the total value int he pivots regardless the dimension value.
I hope this helps.
Regards

Related

sum up days using only existing Excel formulas

I would like to sum up date periods and sum the days per item.
The input data will grow over time and new item categories can appear, so the items (number of rows) that show in the expected report can not be "hardcoded".
The input parameter is the from and to date that determines the period that must be considered. You can imagine this as a moving date window on the input data grid.
I am a Java programmer and I am sure that I can write a proper SQL that groups and sums the data and generate the result. And I can write a Java program too, that does the job, but I really want to do this calculation from Excel.
Is there any way to generate the report by using only a combination of existing MS Excel formulas without writing any Visual Basic code (macro)?
If yes, then could you please put me in the right direction and tell me which formulas I can use? Then I can figure out how to use the formulas.
I hope that this helps to understand better what I would like to have:
Try:
Formula in F3:
=SUM(COUNTIFS(C:C,E3,A:A,"<="&SEQUENCE(H$2-F$2,,F$2),B:B,">="&SEQUENCE(H$2-F$2,,F$2)))
Note that range references that take whole columns will take long to process all data. The above will work even with overlapping dates.

Manually change Numeric parameters for OLAP formula

I had created a Pivot which uses Power Bi model as it's data source (Analysis services). Since my data is huge and there limitations of pivot, I am exploring other ways of pulling the data.
I converted the sample Pivot to Olap Formula and I think this is the best solution from all the options I have explored. But there is some odd situation I am facing where I need some help.
I tweaked the structure as shown below. So now whenever I change any string like in the below example if I manually change the currency from SGD to USD, I am getting the result. But whenever I try to Manually change any numeric value like Segment, I am getting #N/A. The same numbers when pulled using pivot gives the number.
I have tried to insert the numeric value in following ways
40
'40
="40"
=text("40",0)
text to columns->text
but till now I am not able to crack this.
The cubevalue function expects dimensions on which it is going to filter the values. If you want to provide the value manually you'll have to do it like this:
=CUBEVALUE("Sales","[Measures].[Profit]","[Time].[2004]","[All Product].[Beverages]")
Meaning you'll have to change the 40 to something like [MyDimension].[MyHierarchy].[40]

Taking means of irregular amounts data

I'm not able to take the means for a large dataset given that the amount of attributes is irregular.
I have posted a simplified case for the problem. It explains the problem very well.
An idea that I came up with: Make a filter to condition on a single attribute. However, still, I don't see a way to do this in an efficient way (other then doing it all by hand).
see excel file:
All help is much appreciated.
I'm basically looking for a function/method to achieve taking means of all different attributes conditioned on each person for a large dataset without doing it by hand.
You can use AVERAGEIFS() inside an IF:
=IF(OR(A2<>A1,B2<>B1),AVERAGEIFS(C:C,A:A,A2,B:B,B2),"")
the ifrst part of the if tests whether the row starts a new group either by the person or the attribute changing. Then it uses AVERAGEIFS() to return the correct average of that group. otherwise it returns a blank
What you want to do can be accomplished very simply with a pivot table.
Simply select one of the cells inside the range of data you want to process(See the video for general use of a pivot table https://www.youtube.com/watch?v=iCiayB6GrpQ )
go the insert tab and insert pivot table.
Once you have it, simply check people, attribute, and values. Then drag people and attribute into rows, drag valut into the values window, select the drop down list and change it from sum of value to average and you should be done. https://i.stack.imgur.com/nYEzw.png

How to display ratio members in a non-measure dimension (accounts) in Excel

Using the pivot table in Excel with an OLAP Server (icCube), I would like to add financial logic.
The logic is not in the measures as I would like to apply the logic to multiple measures (e.g. amount, last_year_amount, budget etc).
I would like to add the logic to the Accounts dimension. In icCube see 2 ways to do this:
make use of a specific facts aggregation (Unary Operator) (see http://www.iccube.com/support/documentation/user_guide/schemas_cubes/facts_aggregation.php). The logic here is limited to +, -, divide and multiply, and this is too limited for my formulas.
create calculated members in the Accounts dimension.
I have choosen for option 2. This works perfectly, except for the fact that these are not displayed in the Excel add in (the functions children() and members() do not work on calculated items).
This is illustrated in the enclosed picture below.
How can I achieve calculated members in the Accounts hierarchy which are displayed in Excel using the Excel add in?
Note that these calculated items exist. They are just not displayed. How can I achieve that these are also displayed, so a user can select these?
Which version of icCube are you using?
We've found a regression with calculated "measures" being not displayed; but calc. "members" seem properly displayed in a pivot table and within the dimension selectors (right part in Excel).
What kind of object in Excel is the "[+] Ratios" ?
[edit: by the way if a member contains calc-member(s) only, depending on where it is used, Excel might not display them as most of the time AddCalculatedMembers() is being used (this function is adding "sibbling" as calc. members).]

How can this lookup (find the last relevant item) be improved?

One of the reports that wastes a bunch of my time at work is the Roster. It's a multi-site, multi-contract listing of every employee currently assigned to a specific client. Currently, it has a little over 6,000 lines by 20-something columns, indexed against 3 different datasets. Not the largest mess in the world, but still a pain. And it's almost all in excel, because I somehow don't have a business case for Access.
But one part of this monster stands apart. One tab per site Site Totals, listing off every time any agent has gone through training. A second tab (again, one per site) Site Data displaying only the most recent training class, and the credentials they had during that class.
That second tab is driven by variations of this array formula - Last_Row is a named range on another tab, and column A is a pivot of the UID column on Site Totals. I've broken it apart for readability:
=IF(INDEX('Site Totals'!B:B,LARGE(($A2=INDIRECT("'Site Totals'!$A$1:$A$"&Last_Row))*
(INDIRECT("'Site Totals'!B1:B"&Last_Row)<>"")*
ROW(INDIRECT("'Site Totals'!$A$1:$A$"&Last_Row)),1))="Trainer",
"",
INDEX('Site Totals'!B:B,LARGE(($A2=INDIRECT("'Site Totals'!$A$1:$A$"&Last_Row))*
(INDIRECT("'Site Totals'!B1:B"&Last_Row)<>"")*
ROW(INDIRECT("'Site Totals'!$A$1:$A$"&Last_Row)),1)))
I know what this formula does, but I don't know how to improve it. This formula needs to be changed, because it currently is on the order of 500 Million calculations (I'm not allowed to delete historical data), and it takes me 3 hours to calculate the workbook ... if it doesn't crash Excel first.
I'm open to VBA and / or custom functions, but would prefer to have native Excel functions. I'm not able to install anything, so any solution must be native Excel, and Must be compatible to Excel 2007.
If your source is a pivot table, try is the GETPIVOTDATA function. You might be able to accomplish what you want without INDIRECT and INDEX.
What i have understood is that every person has/has not attended a training and you want to retrive the name of that training, in case he has not, you want a blank space in the cell. If this description is correct you can try this formua, press ctrl+shift+enter to execute.
=IFERROR(INDEX('Site Totals'!B$1:B$12,MATCH(A2&"Trainer",'Site Totals'!A$1:A$12&'Site Totals'!B$1:B$12)),"")
Here A2 contians the name of the person. I can be more precise with this formula if you can provide some sample data butI would recommend to not to use entire B & Columns in Site Total workssheete as this will definately slow down computing process, instead you can use B1:B8000 or smaller range, to speed up process. Hope that helps.

Resources