Transistioning from Excel to Access - challenges in assigning/determining a Primary Key - excel

I am currently working on attempting to transition a large database of testing records from Excel to Access to allow for better relational analysis between different groups; however, with how our team completes tests the same tests are repeated on a cycle making it difficult to capture a unique ID -
I have considered assigning one for each test but then realized the ID would still repeat when the test is ran again. I have considered using the timeframe of the review but that would also be repeated unless I build a separate table for each individual test. I have considered using the issue number that would be assigned to items requiring action, but this would not apply to all rows therefore access would not allow it.
Within our current database we capture test name, type, timeframe reviewed, start and end dates, result types, descriptions and root cause, and issue identifiers if remediation is required.
Does anyone have any suggestions on how I might transition this data into Access without losing the Primary Key feature on certain tables?

I would suggest creating a master table to identify your 'test types' (the things that can be run multiple times). You populate this table with the unique entries in the test name column in your Excel data. This column in your Excel data then becomes a 'foreign key' pointing to your master 'test types' table.
Ideally I would recommend using an autonumber as the primary key in the master table and then replacing the test name column in your Excel data with the numeric values generated when you populate the 'test types' table.
You would then import your Excel data into a table that is recording 'Test Run Instances'. Again I would set an autonumber field as the primary key on this table. Other columns in your Excel data that contain repeating data would make candidates for other 'master' tables (e.g. you talk about 'result types' - is there a set list of these that could be moved out to a master table?).

Related

MS-Access Automatically updating data based on another table (Email Blacklist)

I'm setting up a brand new database as a lot of the work we do is on multiple spreadsheets and a lot of the data is duplicated. I have a lot of knowledge with Excel, however, I feel that Access would much better suit the needs of the business and data management.
A large role for many in the business is to send emails/follow-up emails based on criteria, however, we use several services to do this and I need a new method of tracking people/businesses who have 'Opted-out' of email updates, we can export the people who opted out from the different applications and put into a spreadsheet.
I had a little play around with relationships to see if this would work, however, kept getting error along the lines of 'invalid for field type' and although I could do this with a simple countif function in Excel I was wondering if it's possible in Access without VBA.
One of the fields we have for our sponsors/delegates table is email address. I want to know if it is possible to create a new form & table or something to do the following:
User loads form, clicks a button and selects spreadsheet with emails in Column A
Data from column A is then imported into a blacklist table
Access removes duplicates and adds the rest to a blacklist table
Access updates sponsor/delegate table field 'opt-out' to yes for any email addresses added to the blacklist table
Edit: Here are 2 screenshots of the separate tables
What I need Access to do is basically tick the box 'opt-out' automatically for all records where the email matches to one in the blacklist
A query to update the opt-out field in your Sponsors table for all records which have a matching email address in the Blacklist table is relatively straightforward, with the matching operation performed by a single inner join, e.g.:
update Sponsors inner join Blacklist on Sponsors.[Email Address] = Blacklist.[Email Address]
set Sponsors.[Opt-Out] = -1

Concatenated SQL fields in selector and/or custom PXDimension

We have a set of BLC/DAC for a customization that has multiple tables with the given relationship
Table1 - T1ID (int-autoincrement), T1CD (char-substitute key)
Table2 - T2ID (int-autoincrement), T2CD (char-subsitute key), T1ID (reference to T1ID)
where the records in Table2 are unique for each given T1ID selected.
The initial design specification was for the users to select first the Table1 value, then the Table2 value (UsrTable1Value, UsrTable2Value respectively) in the data entry screens.
The users have recently asked if it's possible to combine these into one field simular to a Dimension selector so that there is one field resulting in "Table1-Table2" stored as T2ID.
My first thought was to simply create a subclassed dac with a concatenated property for T1CD-T2CD and base the substitute key off that however performance is a problem when that is done (1.6 million records). The delay is in the framwork side as it appears it processes the entire recordset when generating the concatenated substitute key.
Based on that I thought perhaps instead to simply generate a PXDimension configuration for this however I can't find any reference to make Dimension 2 rely on the value of Dimension 1.
I know i could always create a view that does this but i'd prefer to keep it within the framework if possible.
That basically brings me to two questions
1) Outside of a view, is there way to concatenate fields in the BQL so the lifting is done on the SQL and not with a calculated property?
2) Does anyone have or know of a sample of custom Dimensions where the values in level 2 depend on the value in level 1?
Any suggestions would be appreciated.
Out of the box, dimension selectors are designed to work only with Segmented Keys and won't be able to handle values from multiple tables. In theory, it can be possible to populate segment popup from different tables within a custom DimentionSelectorAttribute. However, this will additionally require to store each T1ID/T2ID pair in a separate table with some other column declared as a key (same concept used in the Sub table to store sub accounts: SubID is a key and SubCD stores values composed from multiple segments).
My personal opinion, the effort is just not worth it. Going one step further, I would check with the customer on how they expect navigation buttons (first, prev, next, last) to work with their segmented input control? If following standard Acumatica UI design with separate input created for every key field, no additional effort is needed to properly handle both data entry and navigation.

Cassandra - join two tables and save result to new table

I am working on a self-bi application where users can upload their own datasets which are stored in Cassandra tables that are created dynamically. The data is extracted from files that the user can upload. So, each dataset is written into its own Cassandra table modeled based on column headers in the uploaded file while indexing the dimensions.
Once the data is uploaded, the users are allowed to build reports, analyze, etc., from within the application. I need a way to allow users to merge/join data from two or more datasets/tables based on matching keys and write the result into a new Cassandra table. Once a dataset/table is created, it will stay immutable and data is only read from it.
user table 1
username
email
employee id
user table 2
employee id
manager
I need to merge data in user table 1 and user table 2 on matching employee id and write to new table that is created dynamically.
new table
username
email
employee id
manager
What would be the best way to do this?
The only option that you have is to do the join in your application code. There are just few details to suggest a proper solution.
Please add details about table keys, usage patterns... in general, in cassandra you model from usage point of view, i.e. starting with queries that you'll execute on data.
In order to merge 2 tables on this pattern, you have to do it into application, creating the third table (target table ) and fill it with data from both tables. You have to make sure that you read the data in pages to not OOM, it really depends on size of the data.
Another alternative is to build the joins into Spark, but maybe is too over-engineering in your case.
You can have merge table with primary key of user so that merged data goes in one row and that should be unique since it is one time action.
Than when user clicks you can go through one table in batches with fetch size (for java you can check query options but that is a way to have a fixed window which will be loaded and when reached move to next fetch size of elements). Lets say you have fetch size of 1000 items, iterate over them from one table and find matches in second table, and after 1000 is reached place batch of 1000 inserts to new table.
If that is time consuming you can as suggested use some other tool like Apache Spark or Spring Batch and do that in background informing user that it will take place.

How to create m2m relationship in PowerPivot

So I am trying to link an employee metrics pivot chart with an employee project table with one slicer. I want an employee slicer that manipulates all charts but the data is coming from 2 different places (SQL, Sharepoint). When I try to create a relationship based on Employees I get the following error: "The relationship cannot be created because each column contains duplicate values. Select at least one column that only contains unique values."
So one chart has quantitative items while the table has qualitative items and I want one slicer to manipulate both at the employee level.
I want to see all the data on both charts for the selected employee, and not just single items linked by unique values. I can use unique values, and have created relationships that one slicer can manipulate however I only get one record at a time that way and therefore the slicer has thousands of buttons (one for each record).
I wouldn't think this would be that difficult and I hope it's really not.
Please Help!
M2M relationships in PowerPivot will most likely cause more headaches than solutions unless you are aware of what you are doing. After some thought, I realized that I really do not want an m2m relationship because it would result in junk data for what I wanted. I just wanted to start my answer off acknowledging that I did not achieve an m2m.
So if you want to link SharePoint data to Excel here is what you need to do:
Export SharePoint data as an RSS feed. If this is something others will need to refresh then the rss file will need to be stored on a shared drive.
Add PowerPivot if you have not already done so. In PowerPivot get external data from other sources (rss feed) then add your file. To link data you will need a Unique ID to join tables on.

Portal displaying data from two tables

I have two tables which both include a date field. Currently I have two portals, one for each table (occurrence).
Is it was possible to display the results of both of these in one portal, and sort by the date?
Technically a portal can only display records from one table. If you need to join two tables then you have to do this manually or change the design and use one table instead of two (since you want them in the same portal, then the tables are similar to some degree; maybe this similarity can go into its own table).
Sometimes developers use the so-called virtual table technique: they create a table with, say, a field with the record number and a bunch of calculated fields that pick their values from elsewhere, for example, from prefilled global variables. They create a portal to this table, set up the relationship to display the required number of records, and write the code to fill these variables. This way they can show data that isn't stored in any table, combine tables, etc. But it's an arcane technique, I would recommend it only as the last resort.

Resources