Not updateable record set - aggregate

I have a set of records linked (1 to many) to another table. The data tables are called tblJobs and tblTasks. I want to show 1) whose task is next 2) all the people who are involved in the tasks and 3) how many are done out of the total, and have this display for each Job.
As soon as I create a query that is aggregated (maybe there is a better way) I can no longer amend the main job data. If I try and create a subform with this info, I can't add subforms to continuous records in a form.
I'm doing all this in Access VBA. Here's an example of data seen on form:
tblJob
Company Name: Smiths
Date Start: 01/01/2023
Data finished: Null
Job Completed: Null (Boolean)
tblTask
Task No: 1
Task: Write email
Who: Bob
Completed: Null (Boolean)
Task No: 2
Task: Create Contacts
Who: Fred
Completed: Null
So here I would want to show with the job data that Bob is next, the job involves Bob and Fred and 0 out of 2 task are completed.
Hope that makes sense and many thanks in advance.
I've tried all the data in one record but it locks the data.
Also tried subforms but the screen then only can show one job at a time (no longer Continuous). Currently I am able to show taks completed by placing a subform in a header of a separate form that only appears using OnCurrent. This only shows the data one record at a time. If there is a way to bring this to the main form, that would be great so all records can be seen at once. Let's start a conversation!

Related

DAX Create Power BI distribution chart and table with grouping processes amount by users amount

Could someone please help with the following issue that I have?
I have dataset which collect data from next process:
Manager_start started process with unique uuid (job_id not unique, because if status don't change to 'finish_pass' it's not close. After Manager_start finished (close) his job - it's automatically assigned on Manager_finish. If status 'finish_decline' - Manager_finish field stay 'blanc' 
I need prepare visualization (table and bar chart)
which will show amount of processes by manager_finish amount. It should look same like this. (For table it should be grouped by Number of processes and for chart on X axis should be amount of processes and for Y axis should be amount of manager_finish who finished process. 
Also should be able to filter visualizations by next filters: uuid, job_id, status, date_finish_working, manager_name_start, manager_name_finish 
I have dataset in table with such columns:
uuid (uuid of process) identifier
job_id (id of job which need to be done))
status - status of process (everytime begins from 'start' and could finish with 'finish_pass' or 'finish_decline')
date_start_working - date when job start get in work
date_finish_working - date when process finished
manager_id_start - id of manager, who start process
I found same case with solution (https://community.powerbi.com/t5/DAX-Commands-and-Tips/distribution-of-calculated-measure/m-p/1047781), but it's not working to my case, because I need to have ability filtering data by different fields and have diffent data structure
Data sample example available by link (upload it to file storage) 
https://fex.net/s/drxzbeo

Efficient way to store multiple data in Postgres

I need to track user tasks. So i came up with few ideas, please suggest which is efficient and good. So the user has around 6 tasks to finish up when they login for first time, lets say task1,task2.....task6. ( tasks are subjective to change in near future )
Approach 1:
Create a table with 10 columns ( extra 4 columns for safety if we need to extend like more than 6 tasks)
Table UserTasks:
task1 task2 task3 task4 ....... task9 task10
Approach 2
Create a table with three columns and have new rows for each tasks
Approach 3
Create a table with array to store all task results (as am using postgres)
Table UserTasks:
id task date
1 [task1:True, task2:false]
Approach 4
Just create a table with VarChar and add custom data to it. For example, planning to add task1 if task1 completed and concatenate task2 if task2 completed
Table UserTasks:
id task date
1 task1,task2,task3
These are the ideas which developed, please help to pick a good approach. The thing is, these data will be READ too often. There wont be any DELETE to this date. A single user would be probably read this data at least 10 times when they logged in so performance is my obvious concern

MS Access: Make Form show only records from last 48HS

I am using MS Access and I have a table called tblLogs, it contains all the logs and a field called logDate. I have created a form in which I need to show the data from tblLogs, but only the records from the last two days. My question is: what are my options?
I've been doing some research and tried making a query which retrieves the data I need from last 2 days, but after doing it I realized there wasn't an easy way to bind query content to a Control (a text box in this case). Another option that came to mind was somehow setting an automatic filter that is triggered when you open the form (don't know how to do it yet), but I don't know if that would be convenient.
So, I'm all ears guys
In the form properties set Filter On Load to Yes and Filter to
logDate >= DateAdd('h', -48, Now())

Volume of an Incident Queue at a Point in Time

I have an incident queue, consisting of a record number-string, the open time - datetime, and a close time-datetime. The records go back a year or so. What I am trying to get is a line graph displaying the queue volume as it was at 8PM each day. So if a ticket was opened before 8PM on that day or anytime on a previous day, but not closed as of 8, it should be contained in the population.
I tried the below, but this won't work because it doesn't really take into account multiple days.
If DATEPART('hour',[CloseTimeActual])>18 AND DATEPART('minute',[CloseTimeActual])>=0 AND DATEPART('hour',[OpenTimeActual])<=18 THEN 1
ELSE 0
END
Has anyone dealt with this problem before? I am using Tableau 8.2, cannot use 9 yet due to company license so please only propose 8.2 solutions. Thanks in advance.
For tracking history of state changes, the easiest approach is to reshape your data so each row represents a change in an incident state. So there would be a row representing the creation of each incident, and a row representing each other state change, say assignment, resolution, cancellation etc. You probably want columns to represent an incident number, date of the state change and type of state change.
Then you can write a calculated field that returns +1, -1 or 0 to to express how the state change effects the number of currently open incidents. Then you use a running total to see the total number open at a given time.
You may need to show missing date values or add padding if state changes are rare. For other analytical questions, structuring your data with one record per incident may be more convenient. To avoid duplication, you might want to use database views or custom SQL with UNION ALL clauses to allow both views of the same underlying database tables.
It's always a good idea to be able to fill in the blank for "Each record in my dataset represents exactly one _________"
Tableau 9 has some reshaping capability in the data connection pane, or you can preprocess the data or create a view in the database to reshape it. Alternatively, you can specify a Union in Tableau with some calculated fields (or similarly custom SQL with a UNION ALL clause). Here is a brief illustration:
select open_date as Date,
"OPEN" as Action,
1 as Queue_Change,
<other columns if desired>
from incidents
UNION ALL
select close_date as Date,
"CLOSE" as Action,
-1 as Queue_Change,
<other columns if desired>
from incidents
where close_date is not null
Now you can use a running sum for SUM(Queue_Change) to see the number of open incidents over time. If you have other columns like priority, department, type etc, you can filter and group as usual in Tableau. This data source can be in addition to your previous one. You don't have ta have a single view of the data for every worksheet in your workbook. Sometimes you want a few different connections to the same data at different levels of detail or for perspectives.

Database design challenge

I'm creating an virtual stamp card program for the iphone and have run into an issue with implementing my database. The program essentially has a main points system that can be utitlized through all merchants (sort've like air miles), but i also want to keep track of how many times you've been to EACH merchant
So far, i have created 3 main tables for users, merchants, and transactions.
1) Users table contains basic info like user_id and total points collected.
2) Merchants table contains info like merchant_id, location, total points given.
3) Transactions table simply creates a new row for every time someone checks into each merchant, and records date-stamp, user name, merchant name, and points awarded.
So the most basic way to deal with finding out how many times you've been to each merchant is to query the entire transaction table for both user and merchant, and this will give me a transaction history of how many times you've been to that specific merchant(which is perfect), but in the long run, i feel this will be horrible for performance.
The other straightforward, yet "dumb" method for implementing this, would be to create a column in the users table for EACH merchant, and keep the running totals there. This seems inappropriate, as I will be adding new merchants on a regular basis, and there would need to be new columns added to every user for every time this happens.
I've looked into one-to-many and many-to-many relationships for mySQL databases, but can't seem to come up with something very concrete, as i'm extremely new to web/PHP/mySQL development but i'm guessing this is what i'm looking for...
I've also thought of creating a special transaction table for each user, which will have a column for merchant and another for the # of times visited. Again, not sure if this is the most efficient implementation.
Can someone point me in the right direction?
You're doing the right thing in the sense of thinking up the different options, and weighing up the good and bad for each.
Personally, I'd go with a MerchantCounter table which joins on your Merchant table by id_merchant (for example) and which you keep up-to-date explicitly.
Over time it does not get slower (unlike an activity-search), and does not take up lots of space.
Edit: based on your comment, Janan, no I would use a single MerchantCounter table. So you've got your Merchant table:
id_merchant nm_merchant
12 Jim
15 Tom
17 Wilbur
You would add a single additional table, MerchantCounter (edited to show how to tally totals for individual users):
id_merchant id_user num_visits
12 101 3
12 102 8
15 101 6007
17 102 88
17 104 19
17 105 1
You can see how id_merchant links the table to the Merchant table, and id_user links to a further User table.