I have about 80k lines of flat data with fields as shown.
I am trying to create a pivot table that splits on Client, Department, Shift, Employee ID, first and last name, hours, weekending date.
I'd like the id#, last and first name, hour info and weekend date to all be on the same line.
Is that possible?
Design->Report Layout->Show in Tabular Form
Related
I have this table showing the names of the employees who worked on jobs where each job can be worked on by more than one employee:
Table 1
And I would like to create a new table comparing the names of the employees who worked on the same job so we could eventually compare their answers, two employees at time. It should look something like this:
Table 2
So if a job was answered by 4 people, then I should end up with 6 rows for the job (4C2) and if it was answered by 16 people, then I should have 120 rows (16C2).
Is there any way I could do this in Excel or in Power BI?
In Power Query:
Select the Employee 1 Name and Employee 2 Name columns and then Unpivot Columns
Select the Job and resulting Value columns and then Remove Duplicates
Remove the Attribute column
I have a csv file that has husband and wife under the same section if there's a husband or spouse for this specific column, and multiple date of birth columns for when there are. Is there a way I can restructure this so that There's an individual column for each spouse, copying name to phone, (grabbing the individual first names if possible), and creating a new row with the individual data from date of birth to PD while removing the extra columns from the first?
I have no experience in excel or csv files to know how to do this, but I was hoping I could check with you guys and see if you're able to format this properly:
Here's a link to some dummy data: https://drive.google.com/file/d/1OGRY0JpMvhVFFEGzdSJwBtYqKXxN-uNO/view?usp=sharing
I would love to know if there's any way to do this, and if so how I can do it for multiple pages of thousands of clients
This data clean-up can easily be done with Power Query (Get & Transform) in the Data ribbon. There different approaches to arrive at your desired result, but I would use the following:
Load the table with all columns into Power Query and call it QHusband
remove the columns with the wife data
remove rows with blanks in column DOB: that leaves just husband data
split the first name column by the & delimiter
remove the column with the wife name
save the query as a connection, do not load into the grid.
Now you have a query that returns just the husband data. Next,
Load the table with all columns again into Power Query as QWife
remove the columns with the husband data
remove rows with blanks in column DOB; that leaves just the wife data
split the first name column by the & delimiter
remove the column with the husband name
save the query as a connection only, do not load into the grid.
Now you have a query that returns just the wife data.
Create a new query that appends the two queries. Load that combined query into the spreadsheet as a table.
When you get new data, you can simply refresh the query
Hope you'll be able to help me.
I have a table with 11 columns, the first one is a date, the next 9 ones are a way of uniquely identifying data and the 11th is a certain amount of money.
What I'm doing in a pivot table is showing the added amount according to one of the identifiers (lines) and dates (columns).
All is well and quite easy to do in a pivot table. Today though I was told that the amounts in my source table are actually cumulative since the beginning of the year.
What I mean is that there are recurring entries in that table and that if I have an entry with the 9 identifiers in january and the same in february and march for example, the value of the one in february is actually (february-january) and for march (march-february).
I could through the unique identifiers just add a column in my source table to identify and calculate the real amount, but I was wondering if there was a way to do so in the pivot table directly ?
Thanks !
Edit :
Here is a screenshot of a simplified version (only two identifiers)
In the fourth column is the amount I have, and in the fifth the real one, that I have to calculate, it is quite easy with only two columns as identifiers.
The goal here is that the pivot table at the bottom shows the "real" amount without me having to create a new column in my source table.
My example table
You can do it using Calculated Items. But it is cumbersome.
A Calculated Item is just another item that a Pivot Table field can take. It is defined in terms of the other items in the same field. For example, the field Date might have values of Jan17, Feb17, etc. A new calculated item called Difference can be added to the Date field and defined as =Feb17-Jan17. This new Difference item will appear whenever the Date field is used to provide row or column labels and the values displayed for it in the main body of the pivot table will be equal to the corresponding values for Feb17 less those for Jan17.
The discussion below is based (loosely) on the pivot table in the picture accompanying the question.
Calculated Items cannot be calculated on grouped fields, so it will be necessary to ungroup the Date field in the pivot table. This will cause the items in the field to be displayed in the same dd/mm/yyyy format as the source data. Changing these to the custom format of mmmyy makes them easier to work with. In English (rather than French) they get displayed as Jan17, Feb17, etc. using this format.
To add a new Calculated Item to the Date field, select any item in this field and locate the Calculated Item option via the ribbon. This has changed across versions of Excel, in Excel 2010 it is accessed via the "Fields, Items & Sets" button of the "Pivot Table Tools/Options" tab of the ribbon. In later versions it accessed via the "Calculations" button of the same tab. A dialog box will appear as illustrated below.
In the Name: box insert a suitable name such as Feb17Xand in the Formula: box enter =IF(Feb17=0,0,Feb17-Jan17). Click "Add" then "OK". The new Date item labelled Feb17X will appear in the pivot table and will show values of 20, 0 and 0 against projects A, B and C respectively.
Feb17X is the decumulated Date item for February. The IF is necessary because although the Amountvalues are cumulative, they only appear in the source data whenever a new Amount occurs in the month (for example Project B and Department IS has data showing for April and June but not for May).
Similar decumulated Date items can be defined in the same way for the other months.
For March, Mar17X is defined as
=IF(Mar17=0,0,Mar17-(Jan17+Feb17X))
and a new Mar17X item is added to the Date field. Unfortunately, this shows values of -28, 0 and 0 against projects A, B and C, respectively. To get the correct values displayed, it is necessary to add the Department field to the row labels in the pivot table (below the Project field) and then to use the "Collapse Entire Field" operation to stop the detail of the Department field from being visible.
The calculated items for the remaining months are added as expected - that for June is Jun17X and has formula
=IF(Jun17=0,0,Jun17-(Jan17+Feb17X+Mar17X+Apr17X+May17X))
Once the new items have been defined for the Date field, a filter is applied in the pivot table to remove the cumulative items ie, Feb17, Mar17, Apr17, May17 and Jun17. This results in the pivot table displaying the sum of the decumulated values as shown below.
A few points:
The zeroes in the pivot table can be suppressed from display by setting the number format of the Amount field to #
In the larger problem where each Amount is defined by a Date, Project and 8 further field values, the row labels of the pivot table will need to include Project and all 8 of the attribute fields. The latter 8 fields will need to be "collapsed out" of the display.
It is much, much simpler to add a decumulated Amount column to the
source data range rather than using the Calculated Item approach set
out here. Sorting the source data by the 9 attributes (Project
first then the remaining 8) and then by Date makes the task
of decumulation very easy. Simply compare the 9 attributes in a row
with the previous row: if the values are unchanged between the two
rows, subtract the previous row's Amount from the current row's,
otherwise leave the current row's Amount unchanged.
The starting data set is the standard output generated from an online application that cannot be altered.
Date, Qty, Item, First Name, Last Name, Email, Comment, Timestamp, Phone, PhoneType
So if the same person orders 2 items (there are only 2 items available for people to choose from), it creates 2 rows, each with duplicate data other than the item and the quantity.
The output data set is desired to be on a new worksheet and sorted by last name, then first name.
Last Name, First Name, Email, Phone, Item 1 Qty, Item 2 Qty
Here is a file with sample input and output data. Sorry, can't post images until reputation >= 10.
https://www.dropbox.com/s/2ig3jdd9n7p2h9w/Example.xlsx
Any help is greatly appreciated, Excel is not my forte!
The simplest way should be a PIVOT table ...
Settings in Pivot Table Tools / Design
Subtotals: Do not show subtotals
Report Layout: Show in tabular form (to get names/1st names in seperate fields)
Report Layout: Repeat All Label Items (for displaying the 2nd Mr. Jones)
Settings in Pivot Table Tools / Options (if you want ... I did it but it's not strictly necessary)
Options / Display / Classic Pivot Table Layout
You can make a pivot table with Last Name, First Name, Email and Phone in the Row Fields, Item as a Column Field, and Qty as a Data field.
I have a list of items - each item has a title, plus a bunch of attributes, including a date.
If I drop the date into the row box of a pivot table, then group it, and drop the title below - so I have Years, Quarters, Created On, Title, I get a nice list of all the titles in my data, grouped by year, quarter and month.
But I want to also display all the other attributes next to the title of each one - all the associated data for each row. With the textural ones, I don't want to count them - I just want to list the entire data set, but grouped by date. If I add them to the other pivot table boxes it starts doing the usual counting...
It would be nice to have all the extra filtering power of pivot tables, but am I making this too hard?
Thanks for your help.
To display text data, you will need to use the data label feature.
Non pivotable text aggregation is easily accomplished in M code in power query One of my posts.