Number reports per subgroup - report

I have a table of Premiership Football teams, and another table of their squad. And I have recorded different stats per player per team. So I have two tables:
TEAM
and
PLAYER
# TEAM
1 Man U
2 Liverpool
3 Tottenham
TEAM # PLAYER SCORED ASSIST ETC
2 Gerrard 4 5
3 Soldado 2 7
2 Sterling 2 3
The TEAM table has the individual players from each team in a subtable for each team.
From this I have created a report from the PLAYER table to show the players name, team, stats etc. What I do need though is to number the records per amount of records in that team in the report itself, almost like page numbers.
For instance, Liverpool say have 20 players, I would like it show Gerrard 9/20, Sterling 18/20. It is one record per page. At the moment, all I can get is their record number, of all the players in the database, like 9/500.
What is the best way of doing numbering records per subgroup(each team)? I thought it would be more simple but doesn't look like it.

It was really simple. I just had to put a
=Count(*)
in the group header, and named it "groupcount". Then add another textbox and have
=[GroupCount]
in the record detail part of the report. Then it gave me the total number of records in each group displayed on each record.

Related

Qualtrics: Assign 4-digit Unique Participant ID number after enrolling via QR code

This is for longitudinal human subjects biomedical research. The basic flow of the enrollment process is this:
Enter clinic & scan QR code OR click email link
Read informed consent form and check I consent [survey]
Pass study screener question (are you 18 yo) [survey]
Contact form - enter your name, phone, email [survey w/ workflow to create XM
directory from this data]
Baseline survey [survey w/ ID number attached]
I have it set up right now that survey 2,3,4 all flow together assuming you meet all the criteria. This study is longitudinal so for every survey I want their ID number attached so we can track changes over time at the person-level. We are also collecting blood samples so I will need their participant ID number on their blood tubes so we know who's who when we process and analyze them. Therefore the nurse will need to know their ID number between steps 4 & 5.
I've seen on the community boards that assigning a random number does not guarantee unique values and that unless you make the number long you might have a duplicate. Can't have that. The numbers must be unique and 4 digits so the clinic staff doesn't get bogged down writing a 10-digit number on a blood tube.
I'd love for this number to be sequential, but beggars can't be choosers.
Any ideas on how to do this?? Here are my thoughts thus far
In step 4 (the contact sheet) set a quota larger than the participants I plan to enroll and then save the quota count as embedded data. Then in the workflow where I create the contact directory, save the quota number into an ID number field. DRAWBACK: if multiple people are enrolling at once, Quatrics Customer Service said they can't guarantee that two people won't have the same quote number but couldn't give details about how to define "at the same time". like clicking it at the same milisecond? second? few seconds?
Use the Qualtrics generated unique Person ID field, which is very long and alphanumeric and somehow re-code it with.... python magic?
Thank you!!!

How to show only highest education in OBIEE

Good evening everyone,
I am using OBIEE and I am trying to extract a file containing some candidates' information to keep in our records, as my organization will need to delete most data soon.
I have data related to recruiting that people put in their applications for job vacancies.
I am trying to have a single row per candidate per application (i.e. if a candidate applied to 2 different jobs, it will count as 2 rows), and insert the highest education, the related insitution, their most recent job title, and the most recent employer name.
I have these facts:
ID,
degree_type,
institution,
job title,
employer.
and they all have the starting date and the graduation date.
When I extract the report, I get something like this:
ID
degree_type
institution
job_title
employer
001
Doctorate
Univ. A
eater
google
001
Master's
Univ. B
sleeper
samsung
001
Other
Univ. A
jumper
apple
002
Bachelor's
Univ. C
clapper
nutella
002
Master's
Univ. D
somethinger
fujitsu
002
Doctorate
Univ. A
somethinger
fujitsu
003
Other
Univ. E
eater
EU
003
Doctorate
Univ. Z
spy
UN
As you can see, each person might or might not have different levels of education, and when I extract this analysis, I have one ID with multiple rows, as many as every degree and every job experience, sorted by chronological order.
This creates some readability issues. Besides, we only want the highest degree and the most recent job.
So something like this.
ID
degree_type
institution
job_title
employer
001
Doctorate
Univ. A
eater
google
002
Doctorate
Univ. A
somethinger
fujitsu
003
Doctorate
Univ. Z
eater
EU
Instead, when I try to apply filters or step, I can only manage to obtain a result based on either
A) the most recent degree and the most recent employer, or
B) each degree and each work experience that was carried out in the same time period of the degree.
Option A does not work for multiple reasons, e.g., if someone got a certification after a PhD, I will have a person with "other" whereas they should have "doctorate"
Option B is not useful at the moment, as we only want one row. Besides, if I worked after getting a degree, that work experience would not appear as it only shows the work carried out during the studies.
I am new with OBIEE, and I am not familiar with SQL. I usually use R, and for completely different reasons.
If I could assign a value to each degree and then filter by the highest (eg., IF there is a doctorate, THEN show it and STOP. ELSE show master's. IF not master's and doctorate, THEN show bachelor's and STOP.) And then add the work experience by date, that would be great.
Is there a way to do this?
Thank you so much! And apologies if it does not make any sense.
PS> I saw this reply already How To Get Highest Education Using MySQL?
but that person has multiple columns for each degree, whereas I have them altogether.
I am assuming that OBIEE is just a DB and you can use SQL to get the info.
I also assume that the ID column you provide represents unique ID per Employee.
Your task requires intermediate if not advanced SQL techniques to solve. Here are the steps.
you need to codify the sort order of the degree level - in 3NF (third normal form) you would add a reference table to store one row per degree and include degree_name varchar column (primary key) to equal the values you list in your post, but then another column degree_sort integer that sorts the degrees the way you want. You would join to this table on the varchar value and return the degree_sort value
Handling ties: Another complexity is how to handle the possibility of a employee having multiple jobs at the doctorate (I presume that is the highest) education level - you would need a "start_date" or some data point to break ties.
Here's a stack post that explains an analogous scenario, getting the record that represents the latest revision of a document (revision is your degree level, document is your employee ID):
https://stackoverflow.com/a/38854846/1279373
Your partition clause would be:
PARTITION BY id ORDER BY degree_sort DESC, start_date DESC
Note: The where clause (see sql in the referred to answer) handles "return only the rows with rank 1"; use ASC (ascending) and DESC (descending) in the ORDER BY clause to rank "low to high" or "high to low".

Change google form questions based on spreadsheet and other questions

I'm currently working on some code for a Google Form for a family football pool we do every year. I have it made to where the user selects their name from a list of competitors and then selects the team they want to pick that week. Each player cannot pick a team more than once and no more than 8 players can select any given team in one week.
Is there a way to gray out teams based on the teams a player already picked? I have a spreadsheet with everyone's name and the teams they picked. I manually update it based on last weeks results, each player is listed in a row with all the teams they picked in the cells next to their name.
Also how do I gray out teams that have already been picked by 8 players that week?

Power BI sum multiple times from a relationship table

I have 2 tables on Power BI
Listened table:
Tracks:
Then I want to make a graph that shows per day the amount of minutes I've heard.
The problem is that, for instance, track #1 was listened 4 times, but it sums only once.
I've tried to create a relationship between tables in single and both direction but it didn't work properly.

What is the difference between Unique Purchases and Transactions in Google Analytics?

Not able to grasp the concept behind these two different terms. Can anyone please help out with an example?
Transactions are the number of purchases or orders from your site, total.
Unique Purchases is the one that trips people up a bit.
From Google's dimension/metrics reference in the API documentation:
The number of product sets purchased. For example, if users purchase 2 frisbees and 5 tennis balls from the site, this will be 2.
That can still be a little unclear, because there are three relevant places that Unique Purchases can show up as a metric: either as a top-line aggregated metric, in a list of products or in a list of transactions.
When you're looking at a list of transactions, Unique Purchases is the number of different products in the transaction. So if you have one transaction with 3 frisbees and one tennis ball, the Unique Purchases value for that transaction will be 2.
When you're looking at a report by product, the Unique Purchases is the number of times that the product appeared in a transaction. For example, if you had two transactions total, one which sold 2 frisbees and one that sold 15 tennis balls, the Unique Purchases would be 1 for each product.
Finally, if you're looking at the top-line aggregate metric for a date range, not broken down by a product or transaction metric, Unique Purchases is the sum of the list of either of the above for all products/transactions. It's effectively the count of all items sold, removing duplicates within a transaction.
So, if you have 37 transactions and 74 unique purchases and 100 quantity overall:
37 Transactions says you had 37 orders for products from your site.
74 Unique Purchases says that that you sold individual SKUs 74 times, though some of those times may include multiple items (which is why Quantity is higher).
Together, these metrics say that people purchased an average of two different kinds of things in each transaction, while the number of items purchased per transaction is closer to 3 (about 2.7).
Unique purchases - It is the count of items sold. Even if the product is sold more than once(or if a quantity of product in a transaction is more than one), report will show the count as 1
Transaction - It is the number of orders on the site. Transaction metric does not indicate the number of products(or quantity of product) in the Order.

Resources