Set the maximum number of row to be added - odoo-12

we are working on a project and this project have the below requirements:
A. project scope is Employee Attendance at Each company Branch
B. each branch has a different maximum number of Employees
C. we want in the attendance screen, to be only limited by the Max. number of the Employees in this Branch,so no one can record an attendance for a number of the employees that exceed the maximum number already registered
based on the below Users Stories
Story 1: as a supervisor, i want to set the max number on employees for each branch, so no more entries could be accepted. i.e:Branch 1 = 5, Branch 2 = 8, Branch 3 = 3
Story 2: as an HR represented in the Branch, i must see just the number of row for each branch
or, the attendance screen don't accept more than the max number
so, there is no error to record unrelated employee number

Related

Data studio calculated fields

I have the following dataset:
Week #
Company Name
Product
# of transactions
Week1
Company A
Product 1
100
Week1
Company B
Product 1
30
Week1
Company A
Product 2
100
Week2
Company B
Product 2
50
My goal is:
for each COMPANY (there could be multiple rows per company) calculate Usage score with the following formula total # of transactions per company/100. For example, from the table above Company A has 200 transactions and Usage score=2 - I've done it successfully
categorize each company per the following formula: when usage score>1 then "promoter" else "critic" - I've done it successfully
Count promoters and critics - that's where I fail. Data studio in this case calculates Usage score and NPS per row, not per company. Therefore, I have promoters per product, not per company.
please help, I'd appreciate
You can solve this by Re-aggregating the Datasource with itself where the Second Join is the Datasource itself with the Key Company Name and the Metric Usage score make sure to set its Aggregation to Average.
Now you have a new Datasource with each Company and Row having its Usage Score in one column.
Unfortunately I don't understand the NPM part.
Hope this help though

Tableau report that aggregates the same row into multiple groups

A vendor has many products in various product categories. A new customer might buy items from one or multiple categories. The data rows represent one order/item combination, such that if three items are bought in an order, there will be three rows in the data set. When trying to answer the question of the average sales total by order category, I want to include each order total in every applicable category. For example, if this is what happened:
Customer #1: Bought $20 in category A and $40 in category B.
Customer #2: Bought $40 in category B.
Customer #3: Bought $40 in category A and $30 in category C.
The data will show:
Row 1: Customer #1 bought $20 in category A.
Row 2: Customer #1 bought $40 in category B.
Row 3: Customer #2 bought $40 in category B.
Row 4: Customer #3 bought $40 in category A.
Row 5: Customer #3 bought $30 in category C.
My report should show:
Category A: Two customers, $130 total (**Not $60**). Average sale per order = $65.
Category B: Two customers, $100 total. Average sale per order = $50.
Category C: One customer, $70 total. Average sale per order = $70.
Each order should get counted in its entirety in every applicable category. This means that a given row of data will get aggregated into multiple category groups. How can I do this in Tableau?
Sounds like a case for a Level of Detail calc! Fix to the Category...
{FIXED [Category] : SUM([Sales])/COUNT([Orders]) }
Be sure to check for division by zero.
UPDATE
In light of the new detail specifying that the data set is item level, not order level, you can count the distinct order numbers instead of counting the number of records.
{FIXED [Category] : SUM([Sales])/COUNTD([Order Number]) }

Jaspersoft Studio subtotal from amount shown on group header

I have data that is "filtered" through three groups.
First group is defined by departments, second is defined by course id and third is for individual class session id (i.e. room and schedule). Also the source query is giving me the list of all students for each class session, and this causes that the other columns get repeated for every student (i.e. credits per course, total enrollment per session, total students dropped per session, total students auditing per session, etc).
When you drop any of those query counts on the report group's footer the sum is not correct. For example if we have 10 students for a session our sum is 100 enrollment. I want to count 10 enrolled students only once.
The amounts are not shown multiple times because I placed the fields on the group header. So on every group break the row of data is displayed only once.
I believe I need a custom running total and not the default created when you drag and drop the field on the group's footer.
I got something working.
On the report Outline I right clicked on 'Variables' and 'Create Variable'.
For example for the audit count I did the following:
Named my variable 'sum_au'
Value Class Name set to java.math.BigDecimal
Calculation set to Sum
Expression set to the query field for the audit total 'AU': $F{AU}
Increment Type set to [Group]GroupBy_CRN
Reset Type set to [Group]GroupBy_CrseNum
All other fields left untouched (default values)
Once this variable is created you can drag and drop it to the CrseNum Group Footer and it will add the values only once per break on the course session id (CRN).
I will reproduce this for the other values to see if this solution is consistent...

Visual Studio 2008 - name with more than one visit. I need an expression to count a distinct name ID on a date

I have a Visual Studio 2008 report with name, nameID, date of service, DOB and several other columns. I need to count the distinct name (using the name ID) visits (date of service). Some names have more than one date of service with more than 1 transaction (names=30, datesvc=36, transactions=80).
They are grouped by Name, NameID (hidden), DateSvc, Transaction.
I thought Count(DateSvc) would work but it gives me the same amount of transactions, not visits.
Any help is appreciated.
I cant put a sample of the data due to confidentiality. But here's a typed sample of it:
Name......Date......DOB......More columns
DOB to the right can be several rows depending on the transaction
Service Date can span one or several rows depending on the date of the transaction
The name spans all rows for that persons transactions on the specific service date
Name.....1/1/16.....9/5/2008.....trans 1 for that day
...............1/4/16.....9/5/2008.....trans 1 for that day (same person)
...............1/4/16.....9/5/2008.....trans 2 for that day (same person)
Name.....6/9/16.....3/7/2002.....trans 1 for that day
Name.....6/9/16.....5/1/2000.....trans 1 for that day
This should show 3 names, 4 visits and 5 transactions
The 4 visits is where I'm having the problem.
Or a Snippet of the above but with data deleted out:
I hope this gives more clarity.
Based on the example you put in your question I built a tablix with the following expressions:
Total Names: =CountDistinct(Fields!Name.Value)
Total Visits: =CountDistinct(Fields!Name.Value & "-" & Fields!Date.Value)
Total Transactions: =Count(Fields!Record.Value)
In your case Record should be MedicalRecordNum and Name should be PatientID instead of the name to avoid counting people with the same name.
The result is:
Let me know if this helps.

Ntile usage in microstrategy

I need to compare last year sales and current year sales based on quintile score and should divide all the customers into 1,2,3,4,5 buckets using NTILE function.
Also need to include 2 more columns(old,new) in the report.
Old indicates customers who comes under 1,2,3,4,5 buckets in previous year but not purchased in current year.
New indicates customers who comes under 1,2,3,4,5 buckets in current year but not purchased in previous year.
For this i have created two custom groups one for previous year and other for current year.
In each custom group i have created 5 filters for 1,2,3,4,5 buckets and in one custom group i have included one more filter for old and in another custom group i have included filter for new.
In report results old and new columns are missing and remaining 1,2,3,4,5 values are getting for previous and current year in form of matrix(6*6).