How to display ratio members in a non-measure dimension (accounts) in Excel - 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).]

Related

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

Column to rows and highlight difference between values in the same group

I have a huge table with data structured like this:
And I would like to display them in Spotfire Analyst 7.11 as follows:
Basically I need to display the columns that contain "ANTE" below the others in order to make a comparison. Values that have variations for the same ID must be highlighted.
I also have the fields "START_DATE_ANTE" and "END_DATE_ANTE" which have been omitted in the example image.
Amusingly, if you were limited to just what the title asks, this would be a very simple answer.
If you wanted this in a table where the rows are displayed as usual, and the cells are highlighted, you can do this by going to properties, adding a newGrouping where you select VAL_1 and VAL_1_ANTE and add a Rule, Rule type "Boolean expression", where the value is:
[VAL_1] - [VAL_1_ANTE] <> 0
This will highlight the affected cells, which you can place next to each other. You can even throw in a calculated column showing the difference between the two columns, and slap it on right next to it. This gives you the further option to filter down to only showing rows with discrepancies, or sorting by these values.
However, if you actually need it to display the POSTs on different lines from the ANTEs, as formatted above, things get a little tricky.
My personal preference would be to pivot (split/union/etc) the data before pulling it in to Spotfire, with an indicator flag on "is this different", yes/no. However, I know a lot of Spotfire users either aren't using a database or don't have leeway to perform the SQL themselves.
In fact, if you try to do it in Spotfire using custom expressions alone, it becomes so tricky, I'm not sure how to answer it right off. I'm inclined to think you should be able to do it in a cross table, using Subsets, but I haven't figured out a way to identify which subset you're in while inside the custom expressions.
Other options include generating a table using IronPython, if you're up to that.

Dynamic Range with Categorical Variables

I'd like to sort a time series of exam performance by one of three categories:
Ideally, a function would sort the scores by "difficulty" while still preserving chronological order. I'd like to do this without filters etc. Something like this is very close, but not quite there. Do I need to use dynamic ranges? Or can I just define data ranges in the table dialog with VLOOKUP or INDEX/MATCH?
I'm thinking a bar graph would be the easiest way to illustrate the data, but I'm open to suggestions. New scores are added every day, with varying difficulties.
Here is the spreadsheet if anyone would like to look it over.
EDIT:
The output visualization could be, for example, a clustered bar graph, but with only one label per category. The idea is that I'd like to preserve chronological order without necessarily having to mark it on the graph.
Would there, for instance, be a quick-and easy and formula-driven way to put these 14 and 17 values for "score" all together under one label? I feel like 17 bar graphs clustered too closely would be hard to read.
I realize this is more of a formatting than a formula issue, but I appreciate input with regards to both.
I would recommend you add a Table over the data in the workbook. One for verbal and one for math. The upside is that it will automatically grow with your data as you add new rows. This is very helpful because charts and other things will automatically refer to the new data. Add one with CTRL+T or Insert->Table on the Ribbon.
Once you have the Table, you can easily do the sorting bit by adding a two column sort onto the Table. This menu is accessible by right clicking in the Table and doing Sort->Custom Sort. Again, the Table is nice here because it will only sort the data within it (not the whole sheet) and will remember your settings. This lets you add new data and simply do Data->Reapply to get it to sort again. Your sort on Difficulty is going to be alphabetic unless you add a number at the front. Here is the sorting step:
With this done, you can create a quick chart based on that data. For the "implicit chronology" you can simply plot score vs. difficulty for all of them since they are sorted.
To get closer to that matrix style display, you can easily create a PivotTable based on this Table and let it do the organizing by date/difficulty. Here is the result of that. I am using Average as the aggregation function since it appears that no dates have more than 1 score. If they did, it would be a better choice than Sum.

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

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

Filtering a PivotTable by Boolean

The source data for my Excel PivotTable looks like the following (this is a simplification):
id name score
1 john 15
2 james 2
3 pat 14
4 jake 12
...
I have a PivotTable that uses this as a data source. Now, what I want to do is have the PivotTable only consider entries if their id is less than 100. This is theoretically achievable by having a Report Filter on id, and de-selecting any number greater than 100. But that's rather absurd.
How can I filter out data using a Boolean constraint? I've tried various methods, none of which worked. It seems like calculated fields are the key, but it doesn't seem possible to create a filter on calculated fields.
I'm using Excel 2011 for Mac, if that makes a difference. I'm a programmer, but I've never programmed in Excel, so if that's the solution, I'd request baby steps. :) Thank you!
AFAIK, In Excel 2011, you cannot use a report filter to apply any kind of filter. You have to manually check/uncheck the values that you want or don't want.
The alternative that I can think of is to insert a column before your data and enter the formula
=If(B2<100,TRUE,FALSE)
and copy it down using Autofill. (See screenshot below)
Now create a pivot and put the field "Less Than 100" in the report filter and simply select TRUE (See screenshot below)
If you don't want to go down that path then move the ID field to ROW LABEL from REPORT FILTER where you can use a filter.
A Report Filter is exactly what I would do, but rather than manually de-selecting the fields as you suggest you would do I would apply a Label filter to be less than the cut-off point, which in your example is 100.
I haven't used Excel on Mac, but on Windows on the PivotTable Field List, to the right of the id field click the little black arrow, and select Label Filters -> Less Than and then enter 100 in the dialogue that pops up.
Given the inherent value of PivotTables is the ability to apply filters exactly for this sort of scenario I don't think I'd do anything more complicated.

Resources