I'm creating a little complex WebI report. I have the following mock up data
Type Type_C Amt
---- ---- --
1 # $500.00
3 # $1000.00
ABC A $10.00
ABC B $14.00
ABC C $15.00
AB A $10.00
AB B $14.00
DAB D $20.00
DAB A $10.00
DAB B $14.00
BC B $14.00
BC C $15.00
My requirement is to show report like this:
Type_Desc Amount
------- ------
A $10.00
D $20.00
E $30.00
ABC $39.00
AB $24.00
BC $29.00
DAB $44.00
I am not sure I fully understand your requirement, but try this.
I created two very simple queries based on the eFashion universe; Query 1 has City and Quantity Sold while Query 2 has State and Quantity Sold. I am not doing a union or any sort of merging here.
In my screenshot tables on the left are the results from each query. The table on the right is actually two tables. I just removed the table header (uncheck Format Table > General > Show table headers) from the second table and put it directly beneath the first table using relative position (Format Table > Layout > Relative Position). I set the column widths in each table to be the same so they will always line up. I also changed the dimension label to "New Dim".
Does that help?
Related
I'd like to append specific columns from multiple tables to each record in a summary table, but only to the records that match Account# and Ticker Symbol in the Summary table
Summary Table
id
Account
Symbol
Value
1
A
JPM
$100
2
B
TSLA
$200
3
C
GE
$300
4
D
JPM
$400
Dividends Table
Account
Symbol
Dividends
D
JPM
3.2%
Purchase Date
Account
Symbol
Purchase Date
B
TSLA
10/2/22
Expected outcome
Multi Query Table
id
Account
Symbol
Value
Dividends
Purchase Date
1
A
JPM
$100
2
B
TSLA
$200
10/2/22
3
C
GE
$300
4
D
JPM
$400
3.2%
I tried Visual Basic (I'm using MS Access 2007) and tried combining just the summary and dividend tables first, but it didn't recognize the "."
Option Compare Database
Function AddCol_1(Summary.Account, Summary.Symbol, Dividend.Account, Dividend.Symbol)
I have a question on this query forever and never figured it out, need some help and thanks in advance for all answers!
I have table 1: Payment (storing historical payment info, I only look at one month data and only type#1 payment, so i need to apply two filters here)
Pymt
ServiceID InsuranceID Amount Month Type
1 A $10 Jun15 1
2 A $15 Jun15 1
3 B $15 Jun15 1
4 C $30 Jun15 1
5 D $50 Jun15 1
Ins
Insurance ID Name
A AAA
B BBB
C CCC
D DDD
Expected Result
Service ID Insurance ID Name Amount Month Type
1 A AAA $10 Jun15 1
2 A AAA $15 Jun15 1
3 B BBB $15 Jun15 1
4 C CCC $30 Jun15 1
5 D DDD $50 Jun15 1
So there are two tasks here:
1. filter table 1 by Jun 15 and Type 1
add a new column"Name" in table 1 to indicate the name of the insurance WITHOUT adding new rows ( it is like a vlookup ) so monthly amount total is the same
I tried differnt joins and WHERE(filter) always added new rows to result which I don't want, please advise.
Thanks!
select p.ServiceID, i.InsuraneID, i.Name, p.Amount, p.Month, p.Type
from Pymt p
inner join Ins i on p.InsuranceID = i.InsuranceID
where p.Month='Jun15' and p.Type=1
I'm just starting out with MS Access 2010 and have the following setup. 3 excel files: masterlist.x (which contains every product that I sell), vender1.x (which contains all products from vender1, I only sell some of these products), and vender2.x (again, contains all products from vender2, I only sell some of these products). Here's an example data collection:
masterlist.x
ID NAME PRICE
23 bananas .50
33 apples .75
35 nuts .87
38 raisins .25
vender1.x
ID NAME PRICE
23 bananas .50
25 pears .88
vender2.x
ID NAME PRICE
33 apples .75
35 nuts .87
38 raisins .25
49 kiwis .88
The vender lists get periodically updated with new items for sell and new prices. For example, vender1 raises the price on bananas to $.75, my masterlist.x would need to be updated to reflect this.
Where I'm at now: I know how to import the 3 excel charts into Access. From there, I've been researching if I need to setup relationships, create a macro, or a SQL query to accomplish my goals. Not necessarily looking for a solution, but to be pointed in the right direction would be great!
Also, once the masterlist.x table is updated, what feature would I use to see which line items were affected?
Update: discovered SQL /JOIN/ and have the following:
SELECT * FROM master
LEFT JOIN vender1
ON master.ID = vender1.ID
where master.PRICE <> vender1.PRICE;
This gives me the output (for the above scenario)
ID NAME PRICE ID NAME PRICE
23 bananas .50 23 bananas .75
What feature would instead give me:
masterlist.x
ID NAME PRICE
23 bananas .75
33 apples .75
35 nuts .87
38 raisins .25
Here is a heads up since you were asking for ideas to design. I don't really fancy your current table schema. The following queries are built in SQL Server 2008, the nearest syntax that I could get in sqlfiddle to MS Access SQL.
Please take a look:
SQLFIDDLE DEMO
Proposed table design:
vendor table:
VID VNAME
1 smp farms
2 coles
3 cold str
4 Anvil NSW
product table:
PID VID PNAME PPRICE
203 2 bananas 0.5
205 2 pears 0.88
301 3 bananas 0.78
303 3 apples 0.75
305 3 nuts 0.87
308 3 raisins 0.25
409 4 kiwis 0.88
masterlist:
ID PID MPRICE
1 203 0.5
2 303 0.75
3 305 0.87
4 308 0.25
Join queries can easily update your masterlist now. for e.g.:
When the vendor updates their prices for the fruits they provide you. Or when they stop supply on that product. You may use where clauses to add the conditions to the query as you desire.
Query:
SELECT m.id, p.vid, p.pname, p.pprice
FROM masterlist m
LEFT JOIN product p ON p.pid = m.pid
;
Results:
ID VID PNAME PPRICE
1 2 bananas 0.5
2 3 apples 0.75
3 3 nuts 0.87
4 3 raisins 0.25
Please comment. Happy to help you if have any doubts.
I have a spread sheet with three columns. the first column contains names of people. the second column contains dates. the third column contains amounts received and invoices paid for the date.
eg:
Name date amount
abc 1-jan-2012 2000 usd
abc 2-jan-2012 (1500) usd
abc 3-jan-2012 2000 usd
abc 3-jan-2012 2000 usd
abc 3-jan-2012 (3500) usd
i am trying to offset the invoices (positive values) against payments (negative value) received. if i use a lifo application then the net_value for the first entry will be 500 USD. the net value for the second entry will be zero.
can anyone suggest a way of automating this exercise. i have written an if statement but the condition does not hold when the payments are more than the invoices (a case of advances being received by the client)
thanks in advance.
this is how the final table will look like
NAME DATE AMOUNT NET VALUE
abc 1-Jan-12 (4,910.00) (4,910.00)
abc 2-Jan-12 3,674.00 (26.00)
abc 16-Jan-12 1,777.00 -
abc 17-Jan-12 (5,477.00) -
abc 22-Mar-12 258.00 258.00
abc 31-Mar-12 5,502.00 1,465.00
abc 7-May-12 3,986.00 -
abc 20-May-12 5,238.00 -
abc 23-May-12 (6,861.00) -
abc 4-Jul-12 (6,400.00) -
abc 9-Aug-12 2,238.00 2,238.00
abc 21-Aug-12 4,855.00 2,456.00
abc 26-Aug-12 (2,399.00) -
abc 9-Sep-12 3,938.00 3,938.00
sorry guys for the confusion...
Do you want to balance for each invoice? If so you are going to want to have a seperate table with all of your invoices and the total/remaining balances can then be calculated for each invoice name/id.
I would probably just use a pivot table that I would refresh on workbook_change:
At least that is how I would do it for a small scale excel reconciliation project. Hope it helps. Good Luck.
Another way you could do it - To create a list of unique invoices you can use this array formula entered with ctrl+shift+enter:
=IFERROR(INDEX($A$2:$A$20, MATCH(0, COUNTIF($E$1:E1, $A$2:$A$20), 0)),"")
Then you can simply do a SUMIF on each invoice ID:
=SUMIF($A$2:$A$22,E2,$C$2:$C$22)
assuming you have the values listed as actual currency amounts, and not the type of text in your example, you can use SUMIF to keep a running total of the account.
in D2:
=SUMIF($A$2:A2,A2,$C$2:C2)
and copy that down. it will show a running total for the status of the account, also keeps note of the items relating to the name in column A, and not for all names.
for your example, this is the result:
Name date amount Running Total
abc 1-Jan-12 $2,000 2000
abc 2-Jan-12 ($1,500) 500
abc 3-Jan-12 $2,000 2500
abc 3-Jan-12 $2,000 4500
abc 3-Jan-12 ($3,500) 1000
Reversed format for a LIFO table - you put the first formula at the last cell (D6 in the example)
=SUMIF(A6:$A$6,A6,C6:$C$6)
and copying it upwards, giving a result that looks like this:
Name date amount Running Total
abc 3-Jan-12 ($3,500) 1000
abc 3-Jan-12 $2,000 4500
abc 3-Jan-12 $2,000 2500
abc 2-Jan-12 ($1,500) 500
abc 1-Jan-12 $2,000 2000
with the total consisting of the amounts on that line and below.
http://www.geocities.com/colinpriley/sql/sqlitepg09.htm has a nice technique for creating a tabular report where the column names for the table can be coded in the query but in my case, the columns should be values from the database. Say I have daily sales figures like:
Transaction Date Rep Product Amount
1 July 1 Bob A12 $10
2 July 2 Bob B24 $12
3 July 2 Ted A12 $25
...
and I want a weekly summary report that shows how much of each product each rep sold:
A12 B24
Bob $10 $12
Ted $25 $0
My column names come from the Product column. Say, any product that has a row in the specified date range should have a column in the report. But other products -- which weren't sold in that time frame -- should not have a column of all 0s. How can I do that? Bonus points if it works in SQLite.
TIA.
http://weblogs.asp.net/wallen/archive/2005/02/18/376150.aspx has a good way to extract columns