I have a problem to solve that I can't handle.
After simplification, I have two tables, the first one with the product. Where for each product we have the price and the financing company, the financing company may be blank (if we purchased the product with our own funds)
in the second table we have financing conditions for individual companies. That is, what percentage of the product amount is financed by own funds and what percentage by the financing company
|financing_company_id ||Downpayment ||Financing |
What I would like to achieve is to create a measure that would calculate for each financing company the value of the capital involved in accordance with the terms of financing. That is, the price multiplied by the percentage of financing
That is, for product 1 it would be 100*90%=90
Complications occur with the financing company "blank" because for it, apart from the value of product prices for which financing_company is blank, I would also like to sum up the product values multiplied by the downpayment value for products for which the financing company is not blank.
So for product 1, I would like for the category financing_company_id = blank to have the calculated price multiplied by downpayment so 100*10%= 10
This is what the table I want looks like
|product4||1000|| || |