How to get the lowest price of products? - ms-access-2010

Table structure
The above Table have 10 products with various price from 3 suppliers. I need to pick the supplier who can give the lowest price.
Just i tried with MS Access 2013. I unable to get the lowest price. Your valuable guidance is much appreciate one.
SID = Supplier ID
PCODE = Product Code
Thank you very much for your time

I assume cheapest means lowest per-ml price per item
So do the following:
create a query#1 that includes the product, supplier, whatever other
fields you want in the final answer, and a calculated field of the
per-ml price.
create an aggregate query #2 on query#1, which groups by product and gives the min per_ml_price. Now you have a "table" with the cheapest price for each product.
Lastly, you want to find the data that matches the lowest price. (Inner-)Join query#2 and query#1, and output the fields you want (product, supplier, etc.)

Related

Calculation based on the price of the selected product in Woocommerce

How can I perform the instant update of the calculation according to the variable product price?
For a simple product, I can calculate the product price according to my own calculation algorithm with php, but if the product has variation, it will probably have to be calculated instantly according to the price of the selected product with javascript. How should I go about this?
If the commission rate is not empty, the calculation below gives the result I want for the simple product.
if(!empty($commission)){$result = $product->get_price()/ ((100-$commission)/100);}

Query number of edges to each connected vertex

I have a dataset with several orders and their respective purchases (called products). The orders are linked to the products they purchased. For a given product P1, I would like to get a list of all "linked" products (i.e. products that were purchased in the same orders as P1) with the number of occurrences (i.e. the number of orders that purchased those "linked" products)
In gremlin, I have already constructed a graph connecting all orders to their respective purchases. I am using Cosmos DB in case that is important. I am able to query all orders that purchased P1:
g.V().hasLabel('PRODUCT').has('id', '2').in('purchased')
I am also able to query all linked products:
g.V().hasLabel('PRODUCT').has('id','2').in('purchased').out('purchased')
However, the first query only returns the orders that purchased P1, and the second only returns the "linked" products. I am unable to get the number of occurrences of each "linked" product. Does anyone have any advice? Thanks in advance...
That's a classic recommendation query. Basically, you're only missing the final step:
g.V().has('PRODUCT','id','2').
in('purchased').
out('purchased').
groupCount()
However, you probably don't want to include the initial product in your result:
g.V().has('PRODUCT','id','2').as('a').
in('purchased').
out('purchased').
where(neq('a')).
groupCount()

Power BI - How do I get the Status correct based on the columns I add or remove

Am stuck in a situation that I cant seem to solve, still learning so would appreciate if you could tell me what am I doing wrong and how do I get this right? It seems simple, but not for me anymore.
Background:
ACME company sells products in various cities and I need to check if ACME is Cheaper, Same or Expensive in terms of pricing. The same product may be sold in 10 different stores in a city and we want to know:
How is ACME doing for each product by City or by Store and I
calculate that as follows:
For each City:
List all the instances of that one product (lets say that product was sold in 10 stores in Dallas,so 10 instances,which means we may have 10 different store prices
Then return the minimum price of these 10 prices
Compare this minimum price against the ACME price and determine whether the product is Cheap, Same or Expensive
Formula:
Measure to calculate min price = 1 Min Price = CALCULATE(MINX(Data,Data[Store Price]),ALLEXCEPT(Data,Data[Barcode],Data[City],Data[Match Type],Data[Store]))
Calculated Column to detrmine status = 2 Price Status = if(Data[ACME Price]<[1 Min Price],"Cheap",if(Data[ACME Price]=[1 Min Price],"Equal","Expensive"))
Problem to be solved:
Screenshot 1 - When i have stores listed along with City, then the formula should consider the Store column and give me minimum price per Store (basically it will do a row by row comparison as a a store will show only once per city) which is what its doing in the "Min Price" and also the status is correct
Screenshot 1 - With Stores
[
Screenshot 2 - When I remove stores, the "Min Price" column is showing the right minimum price for a product per city, however the Status is incorrect - for product ending 7572, both the status must be Equal and for product ending 3566, it should be Expensive
Screenshot 2 - Without Stores
Can someone please advise what am I doing wrong? How do i get the status right when viewing by City?

Microsoft Access Report

I have 2 tables: Customer and Sales. The customer table has:
Customer Number
Customer Name
Customer Location
The sales table has:
Customer Number
Sales Date
Sales Amount
I created the relationship between the tables based on customer number. I can do a query that links up the data from each table.
What I have not been able to do is to summarize my Access report.
I only want Customer Number, Customer Name and Customer Location to show up once and I want each Sales Date and Sales Amount to show up associated with that customer.
Right now, when I do my report, Customer Number, Customer Name and Customer Location gets repeated for each sale.
For instance, if Customer A has 3 sales, Customer A shows up 3 times. I want Customer A to show up once, with the 3 sales listed individually underneath Customer A.
I can summarize it by Customer Number (using a group, I think), but Customer Name and Customer Location still show up multiple times.
I appreciate any advice.
You need to put all fields that you want to show up once in the group header.

Crystal reports, get sum for specific reocrds

In Short:
I need to get a total for customer groups + the credits - the debits in a specific date range.
In Detail:
I'm creating an invoice report for customer orders. Each Customer belongs to a group, and I need to group the invoice by customer group so I can give a total amount owed for the customer group.
So the top Group in the report is customers.group_name with the total for the group in the group header.
The second group is orders.customer_id with the total for the customer in the group header.
I have 2 parameter for the date range of orders which I use in the select expert
I have another table for credits and debits for each group.
This are the fields for the CreditDebits Table
group_name
date_
type_ (this can be either "credit" or "debit")
amount
I've linked customers.group_name with CreditsDebits.group_name in the database expert.
I also use the date range parameters for this table
Do get the credits I created a formula called "credists" like so
if {Credits_Debits.type} = "credit" then sum({Credits_Debits.amount})
But when I drop this formula on the customers.group_name header, the formula shows up as empty and the total for the group gets messed up (it becomes triple of what it should be.
What am I doing wrong?
First check Does this field CreditsDebits.group_name consists of customer name? or any different name?
Place the formula if {Credits_Debits.type} = "credit" then sum({Credits_Debits.amount}) in footer but not in header and check.

Resources