What is the default behavior of adding a date, time, or datetime into an Excel pivot row/column? I have seen it sometimes add it as the "raw value", sometimes it will add it as a Year > Query > Value, and other times (?) perhaps in between. For example:
When does Excel add it without aggregating it, and when does Excel aggregate it? Does it have to do with value cardinality, date range, or something else?
First, every entry in the column has to be a date/time or you won't be able to group them. In that case, obviously, the default would be not grouped.
Assuming everything is groupable, the default is no grouping. Each date will show individually.
The exception is if a pivot cache already exists. In that case it will group based on what the pivot cache says - the last way that field was grouped. This happens when you have more than one pivot table on the same data. The first pivot table creates the cache and all subsequent pivot tables use that existing cache.
In a new workbook (2010), I add a date field to the Row Labels and they are initially ungrouped by default.
I group them by month
Now I go back to the original data and make a new pivot table. I add the date field to the Column Labels.
Because it uses the same cache, it automatically has them grouped the same way. Finally, I go back to the source data and replace one of the dates with a string. If I create another pivot table, it will look like the others. But when I refresh it ungroups them because I have a non-date in there.
And if I try to Group now, it says "Cannot group that selection"
That's why it works the way it does - shared pivot cache. There are ways you can give each pivot table it's own cache but that uses more memory. However, if you want to group the same data differently, that's what you have to do.
Related
I am having an issue with showing last value.
I have a source table, where is every single day (once) and for each day I have for item 1 total amount in stock.
I put it in pivot table. Column for total item in stock, for each day in month July for example, shows me balance for every day. When I group the month, it shows cumulative amount - which is wrong. I need to show last value.
Therefore I searched for a solution, I found on webpage ExcelJet this.
But when I tried it, for some reason, the date 31/07/2020 shows value 0 on top first, and on top second place the correct value for the last day of month.
Does anyone know why that happens? In source data there is 31/7/2020 with only 9.546.
You are applying the filter in the wrong field. You must apply it to your AMOUNT field, and you are applying it to your ITEM field (the field that holds the value VEL).
This is happening because you are working in the compact view of Pivot Table, and I think it's easier to work in tabular design.
Design the layout and format of a PivotTable
My Pivot Table is like this:
As you can see, ITEM and AMOUNT field are in the rows section. And DATE field in the Values section, set to MAX DATE and renamed as LATEST.
The filter is applied in the field AMOUNT.
I know what you mean, but actually the filter is applied on the correct field/row. See the prtscrn.
For the references, I attached the source table too.
btw, if I tried filtered out the column Note it still doesn't work properly
I have a data set of employee's sales over a given period and a blank/custom column to be used for any adjustments needing to be added by Accounting like such:
I would like to have another table whose rows are added anytime the Adjustment column is modified. It would look like this, but with the actual values for the Adjustments column:
The reason for my trying to accomplish this is due to the Data Set is coming directly from a localized Database and loses any adjustments entered in this row when the data is refreshed. There may be a simpler way to accomplish this just using the currently established connection to the database but I'm at a loss.
I am trying to write a calculated member which acts differently depending on whether the user is filtering by that member or has it dragged down as rows or columns on their pivot table (using Excel).
The rules are:
1. If the user is using the date dimensin as a Report Filter in Excel, then the calculated member should get the maximum date out of all dates that they are filtered by.
2. If they have the date dimension as rows on the pivot table, then I need to apply ClosingPeriod and some other logic.
Please try this. The idea came from here.
Basically the dynamic named set represents what's in the report filters. And the EXISTING keyword trims the list of days down to the filter context of the current cell letting you detect say if one month is on rows. Compare counts and you can detect what the user did.
CREATE HIDDEN DYNAMIC SET CURRENTCUBE.SelectedDays as
[Date].[Date].[Date].Members;
CREATE MEMBER CURRENTCUBE.[Measures].[My Calc] as
CASE
WHEN SelectedDays.Count > {existing [Date].[Date].[Date].Members}.Count
THEN Tail({existing [Date].[Date].[Date].Members},1).Item(0).Item(0).Name
WHEN SelectedDays.Count < [Date].[Date].[Date].Members.Count
THEN Tail(SelectedDays,1).Item(0).Item(0).Name
END
Performance is going to not be good. And I suspect users will be confused with the results of your calc. If you want to describe the business scenario more I can maybe recommend a better approach.
I need to create several pivot table once and week, and I wonder if there is any efficient method to drag several item into value field. (I tried to left click on the item I need, but it will automatically go to "row" field.)
And also, is there any efficient method to set up "value field setting"?
I want to summarize value field by "sum", but it will automaticall become "count". If i have 20 items in "value field", I need to click value field setting for 20 times...
Given that you have used the PowerPivot tag then I will assume that you are talking about a PowerPivot PivtotTable not a standard Pivot.
The first thing to do is explicitly create measures (called Calculated fields in 2013) for each calculation you wish to make - not only does this mean you can choose to sum not count but also that you can specify the format you want and once it has compiled, the measure will be added more quickly that just dragging the column into the box.
The easiest way to create a measure is to right click on the table and then in the dialogue box add a formula such as:
=SUM('mytable'[mycolumn])
In the same dialogue you can name the measure and choose the number format.
Once you have the measures you need, you can create a 'set' which is simply a collection of measures/dimensions. The easiest way to do this is create the Pivot you want then go to:
PivotTable Tools>Options>Fields, Items & Sets>Create Set based on....
From there you can name the set and make alterations. Then in future you will see that set in the field list and be able to add it to you pivots with a single click.
Jacob
I am working on processing average CPU loads on some of my servers in Excel 2013. I have my raw data in a table named RawData which contains the CPU load and a timestamp in each row. From RawData I created two pivot tables (loadDaily and loadHourly). In loadDaily, I set the timestamp as a row lable, and set it to group by Days, Hours, Minutes and created a nice chart of my CPU load from it. Now the problem I am having is when I try to group the timestamp field in loadHourly by Hours only, it also applies the grouping to my other pivot table (loadDaily) and my pivot chart linked to that. How do I make the grouping on the timestamp field only apply to loadHourly?
Okay, I answered my own question after toying with it some more. I noticed that after creating my initial groups, in the Pivot Table field list there were new fields (Hours and Days). In my second table, instead of adding the raw timestamp field to it I found out I can use the Hours field that was created when I made my group for the first time.