split up tables according to keywords - excel

I can download excel exports of my monthly transactions from my bank. It gives me a table with the following columns:
[date][account number][amount][debit/credit][account name][code][description]
I want to create a file splits this up into different tables according to certain keywords such as:
Put all transactions where the description contains an item from a list of keywords into category x (e.g: Put all transactions where the description contains "spotify" or "netflix" into the table for subscriptions.)
Put all transactions that don't match any criteria into miscellaneous table.
Add up all items per table per month.
I can't find out which functions to use to achieve this. The filter function seems about right but too limited. Any ideas?

Related

sum values in power pivot using criteria from different table

I have been provided with two tables 1. sales table and 2.Items and it's characters. (The second table has two or more lines for one item if it has more than one characters)
I am trying to get the sum of sales value for the items based on its characters.
I have created a unique characters table and a unique material tables to link to other tables
In power pivot I am able to get the sum of sales by the material in U_Material, but if I include the Characters from U_Item and characters, then I am getting all the characters in the table and the sum, but actually it has only one characters (other characters are repeated with same value). what can i do to solve this.
if I don't include the materials or put them in filter then I get the overall sales value in the output but not as per the category.
Please let me know what I am doing wrong.
The problem is in your model. Your Fact table "Sales" are filtered only by U_Item any of your other tables don't have an impact on it; You should change the model to star/snowflake. Put "Sales" in the center, rest of your tables (Dimension) connect by relationship one to many (many on Sales side);

SSRS Cells auto-merge

I'm having trouble unmerging cells on the report.
3 Suppliers for the query
I have a SQL query that shows 3 instances of a supplier (left joined to contact) as shown below. However, when running the report for the query the 3 instance of the supplier is merged into one. This is not desirable in my case because when exporting the report to excel, I'd like to be able to sort columns based on other properties, however, this would not be possible due the the merging of the rows. How can I get results to show individually?
Cells are Merged on the report
Within the properties of each Row Group you can specify which columns to group on. You generally don't need a separate group for each field, but that's OK. In your last group, the one called "(Details)", if it is not grouped by anything, it will show one row per line of results from the query. So take a look at what it's grouped by. As long as the rows are in your dataset, the report will group or show them based on how you configure the grouping here. Grouping on nothing means it will show all rows.
Another tip is to align the end of your header textbox with the line of one of your columns. This will prevent it from creating an extra column in Excel for the "City" field.
Your report does not need all of those groupings - the SSRS grouping is not like SQL. You should only group when you want to aggregate data on that field. Normally you might have a company with its address in various fields in one group but you only need to group once on the Company Name or (preferably) ID - not on each field and not a separate group for each. You could then show details of various invoices in other columns that aren't grouped.
But since you want to display the company data on each row, you would not want ANY grouping on the company.
To fix your issues, remove all the groupings (but not the rows) and just leave the detail group (which doesn't have a Grouping).
You can check out MS Docs: Understanding Groups for a better explanation.

Excel: Order by date within multiple IDs

I have a huge epidemiological dataset containing registry data with pathology reports and clinical information. I have merged several files into one masterfile in order to get all information from one file. Every patient is assigned an unique ID-number. Each patient can have several reports and hence the same ID number can be repeated several times in the ID column. For each ID entry = new row (= pathology or clinical report) there is a date of that sample/information reported.
My goal is to be able to read all pathology/clinical info for a particular ID within one row.
By sorting the IDs, I get a clear picture of the number of each ID that has been entered. The problem arises when there are several reports = multiple rows with identical ID because the dates within this one patients with several IDs = rows do not match. The dates come from pathology (sample date, answer date, clinical info date etc). The dates from pathology and clinical within one patient does not have to match exactly on the day but still within a reasonable timeframe e.g. within 1-2 months. This is best illustrated with an example.
I want to sort the columns so that dates from a particular row match together. I am sure there is a way to do that but I cannot figure it out.
Thanks in advance
The issue of mismatching records seems to arise once the two separate tables are merged into one. In order to fix this, there are several options you can take:
Re-do the merge but strengthen the way in which the tables are joined on.
Instead of only merging based on ID, see if there is another field that could easily connect the records, perhaps a medical record #, case #, or event #, and merge the tables based on this new field AND ID. This would be the strongest solution, however it will only work if you can find said field to strengthen the link.
A separate solution would be to first sort the original tables based on the dates so that they match up and then re-merging them together.
In theory this should solve your problem as I assume currently when matching up the two separate tables it is grabbing the first instance of patient X01 from both tables and matching them together. This can be confirmed by checking the merged query and looking to see if the mismatched records are in the same order as presented in the original tables. This is not perfect, as it relies on no clinical dates occurring between pathology dates for the record, so I would proceed with caution.
And to address your concern about losing track of ID's with multiple rows, this should not matter as in the end result after merged you can then sort by ID, however you can add multiple levels of sort by selecting the data and going to Data -> Sort -> Add Level. You can change the order in which the data is sorted (First by ID and then by Date).

PowerPivot table relationship showing repeating Totals

I have two different tables whereby one table has Invoice value whereas other table has additional charges. Both these tables have document number (Invoice no) in common.I have used this document number for relationship purpose. Using the relationship I want landed cost for each Invoice no. However, using the relationship, the totals are being repeated. I am attaching the images for quick reference.
I have attached the Snapshot in a single image file a) Source Data b)Desired Result c) What I gotSnapshot of source data, desired result & What i got
In the last 3 columns instead of doing a sum do a max.

Pivot table using 2 data ranges

is it possible to have a single pivot table that combines 2 worksheets as the data?
For example, first data table will be made up of the following columns:
ID/Details/Category
The second data table will be made up of the following columns:
ID/Customer name
The reason why the 2 tables are not combined is because there may be many customer names to the same customer name.
I want a pivot table that will show me the following things:
1) Be able to sort by ID and see for each ID the details linked to that ID sorted by category
2) Be able to sort by customer name and see the details linked to that customer sort by category.
Thank you for your help.
Press Alt+D+P. Select multiple consolidation ranges, choose your two ranges of data, and you've got it.

Resources