How to model more that one product in a classic star schema? - modeling

I am building a classic star schema in a data warehouse for reporting.
My measure is Data(MB) per phone number per month.
My dimensions are Time, Product, Customer and Supplier.
My problem is that some customers have bought more than one product per phone number in some month.
Any ideas on how to implement this in a classic star schema?
Adding these columns to my fact table?
PRODUCT_1_FK
PRODUCT_2_FK
PRODUCT_3_FK
Regards,
Christian

Let's imagine this scenario :
Customer with ID =101 bought the product with ID=100 by phone , on
25 Jan 2021
The same Customer with ID=101 bought another product with ID=120 by
phone, on 28 Jan 2021
How would be in your Fact table?
CustomerSK ProductSK SupplierSK TimeSK
101 100 122 25-01-2021 09:00:30
101 120 189 28-01-2021 16:08:11

if your measure is "Data(MB) per phone number per month" then you can't include Product as a dimension as that would alter the grain of your measure.
If you want to the grain of your measure to be "Data(MB) per product per phone number per month" then you'd need to add Product to your fact and you would have 1 fact record per product

Related

How do I decrement quantity by line in Excel?

New user on Stack Overflow, apologies for my lack of Excel knowledge.
Essentially I have a spreadsheet with all of our customer orders including order number, item SKU, and quantity sold on that order (see pic for example). To estimate profit margin on each of the lines, I'm trying to assign a vendor cost to the orders for each of the vendors.
For example, if we ordered 150 of SKU ABC1 from Vendor1 and 200 of SKU AB1 from Vendor2, I want to assign the cost of Vendor1 to as many orders of that SKU that equal 150, then finish with cost from Vendor 2 for the rest. This will give us an estimate of how much margin we're making by vendor.
Is each order specific to a Vendor? For example, Order 1 is for Vendor 1, Order 2 is for Vendor 3, etc.
If so, you could add the vendor to each order and then use a VLOOKUP to lookup the cost of the SKU for the given vendor. Then it should just be COST * QTY.
Also new here; otherwise, I would have just left a comment.

Assign specific dates based to an employee level dataset on weighted averages in excel

I have a dataset in excel which shows headcount by employee level and which department each employee would fall under (sales, ops, or support). I would like to send a survey to each employee once every 26 weeks (2 times a year), but I would also like to keep sending surveys every week to ensure continuation of surveys to a certain amount of population split between sales, ops, and support departments based on their weight of the total population.
This way, I am sending surveys every week to a tiny bit of my overall headcount but only repeating people every 26 weeks.
Can anyone please help on how to solve this in excel with a formula?
From attached sample data, how can I split the headcount to send surverys for 26 weeks straight but to different population every week and not repeat? This different population should be split by % of department out of total headcount. Meaning if I have 10 people every week and % split is 40% sales, 30% operations, and 20% support, the survey should be sent to 4 sales, 3 operations, and 2 support people. Please note that the 10 people and the %s may vary every week because of new hires and resignations.
Thank you!
Sample Data
In the data sheet, ceate a helper column D, where you hand out the numbers to each employee, label it MOD. Use the formula for each employee, enter to cell D2:
=MOD(ROWS(A$2:A2)-1;$H$2)+1
That way each employee is assign a number from 1 to whatever is in the cell H2, e.g. 26. Then contact list all employees with 1 and you have the first batch and so you continue each week to get to employees with 26 in 26 weeks. This way all get the survey but just once.
Of course the share of the individual depts cannot be achieved each time, as there are less employees in some. If you wanted to keeps the shares, some employees of the smaller departments would get the survey more times.
If you want to get some randomness into the order, just mix the order of MOD numbers, e.g. start with 7, continue with 23 etc.
I hope I got the question right, I am not sure in some parts.

How to handle purchase order in every sales order in Odoo?

Can Odoo handle purchase orders in every sales order that the items are not yet received by the warehouse?
I have this situation where customer 1 and customer 2 order the same products which are not yet in stocks (on-hand-qty = 0). So Odoo will automatically generate a purchase order to buy the items to the vendor and the company will also purchase enough stocks to compensate for the two customers? Now with 45 days lead time until the products will be receiving in the warehouse.
Example:
Item in warehouse = 0
Customer 1 buy 50 units of an item on the same day but different store.
Customer 2 buy 50 units of the same item on the same day but different store.
The company buys 200 units of the same item Since the lead time for the vendor to deliver the product is 45 days now there is Customer 3 which buys the same product on the same day but different stores but only buys 50.
Now in Odoo, it will generate 4 PO ( 3 for the Customer 1,2,3 and 1 for the company) How to make it 2 3 PO instead of 4? since it will compensate the number of items from the company's order but it will wait for 45 days? then another Customer 4 will buy the same items...etc. It will be a series of RFQ that are not necessary to do automatically.

How To Figure Out Repeat Purchase Rate With Multiple Variables

I have data in an excel sheet that is essentially a list of all orders for my company over its life span (approximately 14 thousand orders if it matters.) The following fields are relevant for what I'm trying to do currently.
Purchase date (i.e. 6/23/19)
Customer ID (unique ID given to each customer, this ID is constant across all of a customers purchases)
Product category (widgets, woozits, etc.)
Sales person (John Doe, Jane Doe, etc.)
What I'm trying to figure out is our repeat purchase rate by category, and then by sales person.
So ideally I'd like to be able to determine something like
Product category: Widgets
20% of people whose first purchase from us is a widget, purchased something else later on
Of widgets sold by John Doe to first time customers, 15% of the customers purchased something else from us later on
Of widgets sold by Jane Doe to first time customers, 25% of customers purchased something else from us later on.
So basically trying to figure out if different sales reps have better repeat purchase rates on their orders, however we must divide this by product category as our repeat purchase rate by category is going to vary widely (and some sales reps only sell items from certain categories so it would be unfair to compare across categories.)
I believe to do this I need to figure out how to say something like
"Find every widget John Doe sold ; see how many have customer ID's that did not appear on an earlier date ; then see what % of those customer ID's appear at a later date regardless of the next product category or sales person they purchased from."
Hopefully someone can help. I apologize if I didn't explain something particularly well, if there's any confusion I can try my best to clarify.
Thank you!

Excel Pivot Table - Averaging by Category

I'm trying to create an average by category in a pivot table. This is the first time I've created a pivot table so sorry if the answer is staring me in the face. My raw data looks like:
Date, Transaction type, Description, Paid out, Paid in, Balance, Category
Mar-13, Visa, SHOP, £4.44, , £X, Gifts
Mar-13, Visa, SHOP, £5.00, , £Y, Children
Mar-13, Visa, SHOP, £6.00, , £Z, Gifts
Mar-13, Visa, CLOTHES SHOP YORK, £8.00, , £A, Clothing
Mar-13, Visa, FOOD SHOP, £11.96, , £B, Food
My pivot table shows the information rolled up by Month and grouped by a category:
Row Labels Sum of Paid out Sum of Paid in Sum of Difference
2013
Jan £Jan £Jan £C
Food 1 2 -
Car 2 3 -
Cash 6 6
Feb £Feb £Feb £D
Food 1 2
Car 8 0
Cash 2 3
The categories/data is made up in this case, but the desired outcome I'm after is to get an annual average, informing me how much comes in/out on average across the year per category... looking something like:
Row Labels Sum of Paid out Sum of Paid in Sum of Difference
2013
Avg £AvgIn £AvgOut £AvgDiff
Food 1 2 -
Car 5 1.5 -
Cash 4 4.5
Jan £Jan £Jan £C
Food 1 2 -
Car 2 3 -
Cash 6 6
Feb £Feb £Feb £D
Food 1 2
Car 8 0
Cash 2 3
Is this possible to achieve using a pivot table, as I can't seem to find a way to this at the moment using Excel 2010.
Since it appears that your raw data is already grouped by month, you're able to do this pretty easily. You need to re-arrange your data, however -- the months and the categories need to be on different axes. For example, Category as ColumnLabels, with Values then Month as Row Labels. Then right-click one of the normal values for Paid Out, choose "Summarize Value As...", you'll see SUM is currently checked, just change to AVERAGE. Repeat for one of the Paid In values. The labels should change to help let you know if it worked.
Note that this will NOT work effectively if your source data comes in daily, for example. With only one entry per month, the SUM and the AVERAGE of the single entry are identical. This would not be the case if your raw data was daily (and you still grouped by month) -- you'd be switching from a monthly total to a daily average.
I am currently using LibreOffice, which is just the free version of Excel on a mac. It is basically the same thing, but anyways, do you see the top bar where it says =AVERAGE(B8,C8,D8)? Well, that is how you can incorporate the functions within the table. This is actually a pivot table I had to do for my Java class. All you have to do is click on the cell you want to edit, type =, the function name, (in your case, AVERAGE should be fine) and then any other kinds of functions you use. Hope this helps you out.

Resources