When I'm entering the order Invoice I want to bring the buying price of (Item1) and its Remaining quantities from (purchaseDetail) table,
(Item1) had multiple records in the (purchaseDetail) table depends on it's purchase invoice .
In my continuous subform ordersDetailSubform I have a combobox cboItemsName .
So , depends on the quantity I entered and the previous quantity of Item1 orders I want to bring the buying price list as a row source query of cboItemsName containing only the available quantity prices .
ItemId
quantity
buyPrice
1
5
3$
1
10
2$
Let's say I have previous orders of Item1 of quantity (4) .
If I now entering my new order In my orders form , when I'm typing (Item1) , the cboItemsName row source query show me the Remaining quantities and its prices like that
remaining quantities
buying Price
1
3 $
10
2 $
Can help with the best Ideas to do that ?
It is possible that the remaining quantity of each item and it's bought price appears in the combo box that you have in your ordersDetailSubform but the price that you want to be shown should be the last price of the item that you purchased the item.
For every item one price can come with the remaining quantity in the combo box list.
Thanks a lot!
Related
Hi everyone,
I have 4 ranges of data:
A1:C5 (Product In Storage), there will be new data input if there are other new products coming in.
E1:G8 (Sales), this is the record for all the products that are being sold, there will be new data input also in the future.
I1:K5 (Summary of Sales), this will record the Quantity Left in the storage and also the total Profit or Loss after doing some calculation based on A1:C5 and E1:G8. The number of rows for Summary of Sales should be equal to the number of rows of Product In Storage (So I'm using query function highlighted in yellow).
M1:O5 (Desired Output), this is the final result that I want to achieve for this task.
My goal is to calculate the Quantity Left & Profit or Loss in Summary of Sales automatically once there are new data input in Product In Storage & Sales.
I'm not sure how to do it because the number of rows in Sales is a not a constant. In this example, the are 2 rows data for Product ID: 1001.01 & 3 rows data for Product ID: 1002.01. In the future, after the remaining quantity (34) for Product ID: 1001.01 had been sold, it need to be included in the Summary of Sales as well.
I attached the google sheet link below in case you need it: https://docs.google.com/spreadsheets/d/17coke3-oyDRLHgz79PDl3KX68kFOEte-aynVe-xEITU/edit?usp=sharing
Is there anyway to do this without using the google apps script? Any help will be greatly appreciated!
For your example,
J4 -> =SUMIF(A:A,I4,C:C) - SUMIF(E:E,I4,G:G) means;
(First sumif, get inventory) Whenever you see I4 in A:A column, get the C value on that row and sum all of them.
(And minus)
(Second sumif, minus sales) Whenever you see I4 in E:E column, get the G value on that row and sum all of them.
(Result) = Get storage quantity and substitute the sales quantity.
K4 -> =ArrayFormula(SUMPRODUCT(IF(E:E=I4,F:F*G:G)) - SUMPRODUCT(IF(A:A=I4,B:B*C:C)))
means,
(get income) if you see I4 on E:E column, then get the sum of (F*G)
(minus)
(get expense) if you see I4 on A:A column, then get the sum of (B*C)
But if i were you, to keep things more simple, i would put =Quantity*Price right of your tables and you can solve problems with only =SUMIF formulas. FYI, this will update everytime you change a value from table so when things get nastier, it will become slower indeed. When that time comes, a VBA macro button or Formulas->Calculation method will save your day.
I Have 4 columns I am interested in creating a list. We collected weekly data from our third party vendor. We sort it by the DataCollection week. They do not always submit this data. So, there will be times where a Vender submitted one week but not the next. I need to have a running total of total enrollments by the collection week broken down by the name. I did the MAX function but that only gives me the latest date in the whole table, I want the max for each districts individual date. How do I accomplish this so that say, if the latest week is 2/21/2020 for Name A, and the latest week for Name b was 2/14/2020, I can have both dates and enrollment totals, because as it stands I get only the max date which is 2/21/2020 but the names of those other districts that submitted the data are not coming back.
The code below is what I have.
SELECT DATACOLLECTIONWEEK, NAME,DISTSCH,TOTALENROLLMENTS
FROM DB.SCHEMA.TEST
WHERE datacollectionweek = (SELECT MAX(datacollectionweek)
FROM DB.SCHEMA.TEST)
SELECT DATACOLLECTIONWEEK, NAME,DISTSCH,TOTALENROLLMENTS
FROM DB.SCHEMA.TEST as DB1
WHERE DB1.datacollectionweek = (SELECT MAX(datacollectionweek)
FROM DB.SCHEMA.TEST AS DB2
WHERE DB1.NAME = DB2.NAME)
I have a google sheet that I use to track the different occasion I stock my items for small retail reselling, since the things I buy can have different price on different occasion (discounts, cashback, etc), I need to average the cost of a unique item while also adding the total stocks I have. removing the duplicates.
A B C D E F G
ITEMS STOCKS PRICE PER PCS SUBTOTAL DISCOUNT TOTAL FINALPRICE/PCS
ITEM1 3 $2 $6 10% $5.4 $1.8
ITEM2 2 $3
ITEM4 2 $1.5
ITEM1 2 $1.8 $3.6 10% $3.24 $1.62
So right now, I can put the following formula to column J
to already remove the duplicates and add the stocks of the duplicates.
={unique(A2:A5),ArrayFormula(sumif(A2:A5,unique(A2:A5),B2:B5))}
result as below,
J K
ITEMS STOCKS
ITEM1 5
ITEM2 2
ITEM4 2
But I would also like to average the price per pcs for unique items on column L. Any help is appreciated!
I tried
={unique(A2:A5),ArrayFormula(sumif(A2:A5,unique(A2:A5),B2:B5)), ArrayFormula(averageif(A2:A5,unique(A2:A5),G2:G5))}
This is the error code
Error
Function ARRAY_ROW parameter 3 has mismatched row size. Expected: 24. Actual: 1.
use QUERY instead like:
=QUERY(A2:G,
"select A,sum(B),avg(G)
where A is not null
group by A
label sum(B)'',avg(G)''", 0)
In products table I have fields like
id product_name product_value quantity status
1 abc 10000 50 received
2 efg 5000 15 shipment
3 hij 850 100 received
4 klm 7000 20 shipment
5 nop 350 50 received
I can select multiple rows at a time. And here I selected id=2,4 and need to change the status='received'. How to do multiple update at single time in rails?
Try
Product.where(id: [2, 4]).update_all(status: 'received')
If you are looking for all products that have a status of 'shipment', you can use:
Product.where(status: 'shipment')
From here, you can set all to 'received', or iterate through them and select only the ones you want to make changes to.
The data we display is summarized by order type. Data looks: where ABCDE is the sum of one or more rows with same item #.
Item Order Type QTY PRICE EXT. PRICE
ABCDE INT 10 $100
I am not displaying price because this row is a summary of several in time frame selected. Price on these items changes in time or for customer.
So What I can do is give an average price.
I have 2 formulas but the result is not correct. all result is same number 91,979.00
formula 'new avg' sum({DATA_WHSV3.ITEM_PRC$}) / count({DATA_WHSV3.ITEM_PRC$})
then If {#new avg} > 0 then
sum({DATA_WHSV3.ITEM_PRC$})/{#new avg}
You can use a Running Total Field to do the average for you. So say your report is grouped by Item# you would create a new Running Total Field.
Running Total Name: RTotal0 (can be anything, this is just the default)
Field to Summarize: {DATA_WHSV3.ITEM_PRC$}
Type of Summary: average
Evaluate: For each record
Reset: On change of group: Group #1: DATA_WHSV3.ITEM_NUMBER
Then you can drop the {#RTotal0} into the group footer along with the other details for that item number and it should be the correct average.