Excel Pivot table grouping Row Labels that are Percentages - excel-2007

Here is my data (apologies for poor formatting, maybe that should have been my first question!):
Customer Percentage Increase
1 2%
2 12%
3 -50%
4 87%
5 -20%
6 -1%
7 123%
8 -98%
9 10%
10 13%
I created a pivot table in Excel with Percentage Increase as the Row Labels and Count of Customer as the value.
Row Labels Count of Customer
-98% 1
-50% 1
-20% 1
-1% 1
2% 1
10% 1
12% 1
13% 1
87% 1
123% 1
Grand Total 10
I then wanted to group the percentages to something easier to read, but the percentage ranges do not show percentages, instead they show regular numbers.
Row Labels Count of Customer
<-0.5 1
-0.5--0.25 1
-0.25-0 2
0-0.25 4
0.75-1 1
>1 1
Grand Total 10
How do I get the number formatting of my percentage ranges to be percentages, i.e. 0% - 25%, etc?
Thank you.

The only way I know is to change them by hand, i.e., click into the cell with the label and change it to say what you want.
If you do this, I'd also create the labels for the categories that don't show up yet, e.g., 25% to 50% (and 50% to 75%) in your example. To do this, choose Field Settings>Layout & Print and check "Show items with no data". Change the labels for those ranges as well. Once you do, you can uncheck "Show items with no data", and in the future if there are counts in new ranges the new labels will still be what you entered. (At least it seems to work that way).

Related

sql more complicated querying measurements

I have two tables (sql server), as shown below:
locations
id cubicfeet order
-------------------------------------
1 5 1
2 10 1
3 6 1
items
id cubic feet order
--------------------------------------
1 6 1
2 6 1
3 6 1
I need a query to tell me if all the items will fit into all the locations (for a given order). If all items will not fit into 1 or all locations then I need to create a new location for that given order - and then move any items that DID fit into the locations before to the new location (as many as fit). The new location will only be given a certain amount of cubic feet also - say 17. In this example, sum won't work because all 3 records are 6 so the sum is 18, which is less than the sum of 5,10,6, but the location with volume 5 can't fit any of the items since they are all volume 6 cubic feet.
the only way I think I can do it is creating temp tables in my sp and using a while loop to go through them and update the locations 1 at a time to see if it still fits more...

how to calculate a rolling average based on a column in spotfire

I have a data set where you have a Document Property that Selects "items", each "item" has a particular "usage days". I want to calculate an output of "Moving Average" for 1 or more selected items. the data for the moving average lives under a column named "usage days".
How do I calculate this taking into account the "selected date of my choice" and the rolling average number of days of my choice.
Do you have particular ideas of how I can perform the calculation i.e. in a calculated column or a text field?
Car/ Trip / Start Date/ End Date / Days on trip
1 AB123 / 2 / 6/07/2013
1 AB234 / 29/07/2013 / 6/09/2013 / 42
1 AB345 /6/09/2013 /28/09/2013 /22
1 AB456 /29/09/2013 /21/10/2013 /23
2 AB567 / 26/10/2013 / 12/11/2013 / 22
2 AB678 /12/11/2013 /8/12/2013 /26
[The rows above have an example of the problem (sorry couldn't paste an image because im new), I want to calculate the %usage of the Car and or cars for a selected range of time e.g (Select date range JUlY to AUGUST then (#of days on trip for car 1and 2)/#on days in that period)/2*100]
As phiver said, it is still difficult to see what you expect as a result... but I think I have something that might work. First, I slightly altered the dataset you provided, like so:
car trip startDate endDate daysOnTrip
1 AB123 7/6/2013 7/29/2013 23
1 AB234 7/29/2013 9/6/2013 42
1 AB345 9/6/2013 9/28/2013 22
1 AB456 9/29/2013 10/21/2013 23
2 AB567 10/26/2013 11/12/2013 22
2 AB678 11/12/2013 12/8/2013 26
I then added 2 document properties, "DateRangeFirst" and "DateRangeLast", to allow the user to select beginning and ending dates. Next I made input box property controls for each of the aforementioned document properties in a text area so the user can alter the date range. I then added a datatable visualization with a "Limit data using expression:" of "[startDate] >= Date(${DateRangeFirst}) and [endDate]<= Date(${DateRangeLast})" so we could see the trips selected. Finally, to get the average you appear to be looking for, a barchart set to % of total (daysOnTrip) / car with the same data limiting expression as above. The below screenshot should have everything you need to reproduce my results. I hope this gives you what you need.
NOTE: With this method if you select a date in the middle of a trip, an entire row and all of the days on that trip will be ignored.

Ignore non-empty values when aggregating

I have a cube I've built with three separate measures: "TY Sales", "LY Sales", and "% Change", what I'm trying to do is have special behavior for the aggregate rows, basically not including any "LY Sales" values when summing the total if "TY Sales" is 0. So currently my cube works like below:
LYSales TYSales %Change
Year 1 450 300 -33%
Week 1 100 125 +25%
Week 2 150 175 +14%
Week 3 200 0 +0%
The aggregate column "Year 1" in this example, is summing all values for each sales measure. What I want it to do instead, is only include values in LYSales if TYSales also has a non-zero value. So my ideal state would be below:
LYSales TYSales %Change
Year 1 250 300 +20%
Week 1 100 125 +25%
Week 2 150 175 +14%
Week 3 200 0 +0%
I'm new to SSAS, so any guidance is appreciated. Thanks
An easy and reliable way to achieve that would be to change the source column of LYSales to be zero if TYSales is zero. This would be done in the fact table on which the measure is based. You could implement that
either in the ETL process, changing the LYSales column values to be zero when TYSales is zero,
or in a view based on the fact table that is then used in the Data Source View instead of the original table,
or as a Calculated Calculation of the fact table in the Data Source View.
In the latter two cases, the calculation formula would be SQL like this:
case when TYSales <> 0 then LYSales else 0 end
Then switch the measure definition to use that column.

MDX weighted values

I have a cube built on a fact which, amongst others, includes the Balance and Percentage columns. I have a calculation which multiplies the Balance by the Percentage to obtain an Adjusted Value. I now need to have this Adjusted Value divided by the sum of all balances, to get weighted values.
The problem is that this sum of all balances doesn't apply to the whole dataset. Rather, it should be calculated on a filtered subset of the whole data. This filtering is being done in Excel using a pivot table, so i do not know what conditions will be used to filter.
So, for example, this would be the pivot i'd like to see:
ID Balance Percentage Adjusted Value Weighted Adjusted Value
1 100 1.5 115 0.38 (ie 115/300)
2 50 2 51 0.17 (ie 51/300)
3 150 1 150 0.50 (ie 150/300)
300 is obtained by summing the balance of the rows that show in the filtered pivot.
Can this calculation be somehow done in OLAP? Or is it impossible to compute this sum with what i know?
Yes should be possible; e.g., assuming 1/2/3 are the children of a common parent, then the following calculated measure should do the trick :
WAV = AV / ( id.parent, Balance )
If not we would need more information about the actual data model and query.

How to use SSRS to report using a custom, "matrix-ized" table

First up, my environment: SQL 2005 + MS DAX 2009.
We have made a table that gets used in a matrix-like fashion for entering in purchase orders via an AX form. So each row will have:
a column for item#
a column for color
columns 1-7 for size (size1, size2,...), quantity (qty1, qty2,...), and cost (cost1, cost2,...).
I am trying to create a report in SSRS that basically uses this data in a more list-like fashion for printing out a PO order form.
I have got it to show the sizing right, but the cost situation complicates it as the unit cost can, and does, differ depending on size (for instance 2XL is more than S-M-L).
For example in our table, item 10000 black has 3 for Small (this data would be qty1), 3 for Medium (qty2) and 4 2XL (qty5). The cost for qty1 and qty2 are the same at $2.50 (cost1 and cost2). The cost for qty5 (cost5) would be $4. I would like to have this broken out into 2 rows by the cost and associated size on the form. So one line would have 10000 black Small and medium info and the second row would have the same item and color, but only have 2XL and its cost data.
Is there a way to "match" fields or somehow cycle through them to get the correct cost without having to have an additional 7 cost columns? Or perhaps there is a more elegant solution that is escaping me?