Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am trying to help a friend who wants to set uo a MLM organisation. He needs to calculate income for everyone he will enroll.
The issue is that a top-level employee gets his own commission PLUS a percentage of everyone's commission he has enrolled...
[Do]
...these guys in turn get their own commission PLUS also a percentage of everyone's commission that they have enrolled, and this additional commission also has an upstream effect on the top level guy's percentage (this goes all the way down the line)...
[Loop]
potentially, this goes on ad-infinitum. So I can't calculate the upstream commission until I have calculated the commission right down to the bottom, but there may be hundreds of levels.
In the data I'm looking at, I know everybody's sales and I know the ID no. of the person who has enrolled them, I don't necessarily know how far down a chain they are.
How can I model this for him? I can't get my head round it.
Has anyone else ever had to work this out? Am I missing something obvious?
Thanks
You have typo error in following formula:
=SUMIFS([Upstream commision - outgoing],[Parent ID],[ID])
shoud read
=SUMIFS([Upstream commission outgoing],[Parent ID],[ID])
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I am using db 18C XE AND APEX 21.1. I am designing a database for private clinics. A private clinic is a place where patients get diagnosed. The clinic has only one doctor and an assistant or two. The assistant records the patients' data and visits(admission) data. The patient gets diagnosed at the first visit and get a prescription with the drugs they should take. Then a follow-up or more visits follows afterward i.e the second visit is after two weeks then a third one after a month and so on. Each follow-up has a new prescription or maybe the same prescription if the doctor thinks there is no need for a new drug. The patient could be diagnosed for a disease then gets cured after a number of visits. Then he could visit the clinic again after a year or two for a different complain. The same process occurs again. I am attaching a photo of the part of the visits, examining and follow-ups. I want to be sure if I designed it correctly.
As far as I am able understand your use case, the follow up table will record the follow up visits of the patient. Since you have columns like dose, drug_id etc in FOLLOW_UP_PRESCRIPTION table, I think there must be a patient id as well to map drugs/medicines with the patient.
Correct me if I'm missing something
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
a Create a PL / SQL block that shows ids not assigned to employees.
b. Create a PL / SQL block where you place the department's id and return the name of the head of that department.
c. Create a PL / SQL block where you place the id of the employee and return the names of the charges it has occupied in the past.
the ponit A ITS DONE ---- all the id's are full so it does not show results.
enter image description here
the point B dont work
enter image description here
As mentioned in my comment:
Looks the dbms_output is not enabled in your session. Click on the plus sign at the end and choose the schema and then re-run the block. See below circled in red.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
How to find amount exclusive of tax from an amount inclusive of tax?
Currently I'm using this query and getting the desired result.
I am searching for a simple query.
My current query:
select #amountExclusiveOfTax=
(#amountInclusiveOfTax) -
((#amountInclusiveOfTax) - (((#amountInclusiveOfTax)/#taxPercent+100) * 100))
Is there any easier way?
This was taught in day one of my business math class:
SELECT #amountExclusiveOfTax = #amountInclusiveOfTax / (1 + #taxPercetange / 100)
This assume your #taxPercentage is stored in percentage form. For example, if the tax is 15%, then #taxPercentage = 15. Another popular form is the decimal form, where it's stored as 0.15.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a table A having name of people and Table B having name of people and their membership with different organization. Is there any way I can get the total number of membership of each and every people using count function or any way?
Is there any way I can get the total number of membership of each and every people using count function or any way?
Did you try a Pivot? See screenshot below
I have taken a scenario as you mentioned in Andy G's post... with multiple memberships...
You haven't explained how SQL is involved, but if the two tables are both in Excel then you only need to count the number of times each name occurs in the second table, using COUNTIF and copying this formula down the column:
I'm assuming their membership of an organization is not repeated in the 2nd table.
Added It is more complicated knowing that the combination of person and organization repeats in the second table, but it can be done with an array formula. Use Ctrl-Shift-Enter to complete the following formula, then copy it down the column.
=SUM(IF($E$2:$E$13=A2, 1/(COUNTIFS($E$2:$E$13, A2, $F$2:$F$13, $F$2:$F$13))))
I cannot claim origination for this, a colleague of mine Rudi completed it for me.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am in the process of adding accounts receivable to one of my webapps. Essentially, I want to be able to create sales invoices and record payments received.
The reports, I generate are
statement with balance outstanding
invoice
receipt
To create a statement, I was thinking of doing a union of receipts and invoices ordered by date.
I also need to cater for refunds/credits, which i am doing by refund = receipts with a negative amount, and credit = invoice with a negative amount.
All the invoices/receipts are exported to a full accounting package (so don't require double entry system at this end)
What i have come up with is
INVOICES
id
customer_id
total
tax_amount
reference
user_id
created
INVOICE_LINES
id
invoice_id
description
qty
unit_price
total
tax_amount
RECEIPTS
id
customer_id
reference
internal_notes
amount
user_id
created
Is there anything that i am missing?
Would a single transactions table be simpler instead of having separate invoice/receipt tables?
Another thought, is it normal to link a receipt to an invoice? what if a receipt was for multiple invoices.
Any advice appreciated (simplicity is the goal)
Look at the "Library of Free Data Models" from DatabaseAnswers.org
They have many basic designs that should inspire you.
For example "Accounting Systems"
Have a look at this similar question Database schema design for a double entry accounting system? . I came across it googling for 'bookkeeping database design' as I reckon you'll easily find free or relatively low-priced databases already exist - as you say - simplicity is the goal.