Access 2010: filter from multiple records in memo field? - filter

I've poured through here looking for an answer to this, but haven't found it anywhere.
I have an Access 2010 database with two tables:
one with about 14k codes and definitions(all five digits, including some letters).
one with a total of 900k records, each record containing pairs of combinations of these same codes (each code in the pair in a separate column, CODE1 and CODE2)
When our office gets a new project, I have to check to see if the codes used in the project match any one of those pairs of combinations. Some projects only use two codes, but some can have as many as twenty or more.
I would like to be able to enter in all the codes used in any one project into either a text field or memo field, then have Access show me if a combination exists between any of those codes.
Example: If I have 5 codes, I want to see if any of the 900k pairs of codes contains ANY 1 of those 5 codes in both CODE1 and CODE2.
Anyone know how to do this, or if this is even possible in Access 2010?

No, I think you want another table with the code IDs (2-20) for each project, then you can cross join it with itself to get your set of pairs, then inner join it with your pairs table, 900k

Related

Using PowerQuery, is there a way to view a sheet of different-sized groups of data as a single table?

I have a sheet of non-table groups and would like to view them as a single table.
Each group consists of 4 or 5 rows and 2+ columns with 1 or more blank rows/columns between.
Overall, the groups are organized into rows and columns on the sheet. There shouldn't be more than 3 groups in a row, but some rows may have blank spaces for future groups.
New groups and group columns are added regularly so existing groups can be relocated on the sheet anytime.
The group names are a unique combination of letters and a number. Unfortunately, they are not prefixed "Group" or numbered consecutively like in my example. Giving a generic example that conveys all criteria is harder than it looks 😅.
This is a shared document so I'd like to avoid making structural changes that would affect other users.
I've experimented with some of the transform options, but I'm new to PQ and didn't make much progress.
This answer to a similar question is a step in the right direction, but it looks like I'll need additional steps since my starting data isn't quite as consistent.
Thank you for your time.
Before Example
After Example

How to get the sum of values of a column in tmap?

I have 2 columns - Matches(Integer), Accounts_type(String). And i want to create a third column where i want to get proportions of matches played by different account types. I am new to Talend & am facing issue with this for past 2 days & did a lot of research but to no avail. Please help..
You can do it like this:
You need to read your source data twice (I used tFixedFlowInput_1 and tFixedFlowInput_2 with the same data). The idea is to calculate the total of your matches in tAggregateRow_1, it simply does a sum of all Matches without a group by column, then use that as a lookup.
The tMap then joins your source data with the calculated total. Since the total will always be one record, you don't need any join column. You then simply divide Matches by Total as required.
This is supposing you have unique values in Account_type; if you don't, you need to add another tAggregateRow between your source and tMap_1, in order to get sum of Matches for each Account_type (group by Account_type).

Google Sheets Extract Data from Table and make a row per data set

I'm stuck with Google Sheets.
Situation:
I have a data table with projects. Each project as a few attributes, most importantly including which team member has worked on the project this month.
Goal:
I need to convert the data to a new table that is built up differently. I need one row per project per active team member.
Sample data and goal:
https://docs.google.com/spreadsheets/d/1QcNPsvHX8hBNUpCJiutof8yD8ukFYcCXM_pLNrQmDUs/edit?usp=sharing (can edit)
As you can see, SEO and Island now have two rows instead of one, as Jan AND Chris have worked on the projects this month.
Approach:
I tried FILTER, QUERY (with pivot) and thought about Scripting (basically its an iteration over the Matrix B3:E8...). However, I am not particularly skilled at Sheets and am very thankful for your help. Thanks a billion, guys!!!
You can do this a fairly standard way by using Textjoin to join together the corresponding column headers and other data for the non-blank cells, then separating it into rows then rows and columns with the Transpose and Split functions:
=ArrayFormula(split(transpose(split(textjoin("¶",true,if(B3:E8="","",A3:A8&"|"&F3:F8&"|"&G3:G8&"|"&H3:H8&"|"&I3:I8&"|"&B2:E2)),"¶")),"|"))

How to conditionally require 18+ fields based on selection of two dropdowns

I'm new to Sharepoint 2010 with what I would call a highschool freshman level of coding experience, though I can generally stumble and tinker my way through. I don't currently have access to Sharepoint designer, but from the searching I've done so far, it may required. Still I'm hoping to find an OOTB solution to the problem below.
I have been tasked with building a incident resolution tracking sheet on Sharepoint. My boss is very concerned with being audited by legal, and has some very specific requirements about required information. Column A contains a drop down list of 5 choices that indicate the Final Solution. Column B Contains a drop down list with 4 choices that indicate the Initial Problem. Based on The selections in A and B, different Columns in C-X are required to be blank, not blank, or contain specific entries. The only way I can find to do this is to create a list validation containing a nested if for each combination of A and B resulting in 20 nested ifs. However sharepoint is limited to 7 nested ifs, so I'm looking for any possible solutions.
*This List will primarily be accessed in Datasheet view, so "HTML in calculated column" type solutions are not viable.
You can use calculated columns to break up the validation formula into more manageable chunks.
Let's start with a simple example.
Condition 1: If the initial problem was that the user's computer was too slow and the final solution was restarting the computer, you need to fill in the [C] column.
Condition 2: If the initial problem was that the user was on fire and the final solution was dousing them with water, you need to fill in the [D] column.
You could perform that list validation all in one formula, as below:
=IF(
AND([A]="Restarted Computer",[B]="Computer is slow"),
NOT(ISBLANK([C])),
IF(
AND([A]="Doused with water",[B]="User is on fire"),
NOT(ISBLANK([D]),
TRUE
)
)
But that's long and ugly (especially when you condense it to one line).
Instead, you could add two calculated columns, one for each condition you want to check. For the sake of this example, let's say you add a column called C_is_valid and a column called D_is_valid:
C_is_valid calculated column formula:
=IF(AND([A]="Restarted Computer",[B]="Computer is slow"),NOT(ISBLANK([C])),TRUE)
D_is_valid calculated column formula:
IF(AND([A]="Doused with water",[B]="User is on fire"),NOT(ISBLANK([D]),TRUE)
Updated validation formula:
=AND([C_is_valid],[D_is_valid])
It's easy to see how this can simplify even a very complex set of validation conditions...
=AND(C_is_valid,AND(D_is_valid,AND(E_is_valid,AND(F_is_valid,AND(G_is_valid,AND(H_is_valid,I_is_valid)))))
But even that could be simplified by consolidating some of those AND()s into multiple calculated columns, so that your final validation formula could be as simple as:
=AND([First set of conditions is valid],[Second set of conditions is valid])

a bit of a string matching conundrum in excel-vba

i'm writing a program at work for a categorizing issue.
i get data in the form of CODE, DESCRIPTION, SUB-TOTAL for example:
LIQ013 COGNAC 25
LIQ023 VODKA 21
FD0001 PRETZELS 10
PP0502 NAPKINS 5
Now it all generally follows something like this...the problem is my company supplies numerous different bars. So there are like 800 records a month with data like this. My boss wants to breakdown the data so she knows how much we spend on a certain category each month. For example:
ALCOHOL 46
FOOD 10
PAPER 5
What I've thought of is I setup a sort of "data-base" which is really a csv text file that contains entries like this:
LIQ,COGNAC,ALCOHOL
LIQ,VODKA,ALCOHOL
FD,PRETZELS,FOOD
FD,POPCORN,FOOD
I've already written code that imports the database as a worksheet and separates each field into its own column. I want excel to look through the file and when it sees LIQ and COGNAC to assign it the ALCOHOL designator. That way I can use a pivot table to get the category sums. For example I want the final product to look like this:
LIQ013 COGNAC 25 ALCOHOL
LIQ023 VODKA 21 ALCOHOL
FD0001 PRETZELS 10 FOOD
PP0502 NAPKINS 5 PAPER
Does anyone have any suggestions? My worry is that a single point expression match to JUST the code i.e. just to LIQ without a match to COGNAC as well would maybe result in problems later when there are conflicting descriptions? I'd also like the user to be able to add ledger entries so that the database of recognized terms grows and becomes more expansive and hopefully more accurate.
EDIT
as per #Marc 's request i'm including my solution:
code file
please note that this is a pretty dumb-ed down solution. i removed a bunch of the fail-safes and other bits of code that were relevant to a robust code but not to our particular solution.
in order to get this to work there are two parts:
the first is the macro source code
the second is the actual file
because all the fail-safes are removed, the file needs to be imported to excel exactly the way it appears. i.e. Sheet1 on the googleDoc should be Sheet1 on the excel, start pasting data at cell "A1". before the macro is run, be sure to select cell "A1" in Sheet1. as i said, there are implementations in the finished product to make it more user friendly! enjoy!
EDIT2
These links suck. They don't paste well into excel.
If your comfortable with it I can email you the actual workbook. Which would help in preserving the formatting etc.
Use a lookup table in a separate sheet. Column A of the lookup sheet contains the lookup value (e.g. PRETZELS), Column B contains the category (FOOD, ALCOHOL, etc). In the cells where you want the category to show up in your original sheet (let's use D3 for the result where B3 holds the "PRETZELS" value), type this formula:
=VLOOKUP(B3,OtherSheet!$A$1:$B$500,2,FALSE)
That assumes that your lookup table is in range A1:B500 of a worksheet named "OtherSheet".
This formula tells Excel to find the lookup value (B3) in column A of your lookup and return the corresponding value from column B of your lookup table. Absolute references (the $) ensure that your formula won't increment cell references when you copy/paste the formula in other cells.
When you get new categories and/or inventory, you can update your lookup table in this one place by just adding new rows to it.

Resources