sum crystal report different month - sql

I'm using Crystal Reports 2008. And I have database access 2003 "myclass" with table "Class" an output of like this:
----------
Date Total
12/2015 100
01/2016 115
02/2016 150
03/2016 180
----------
Now, my question how formula for "Previous_Total" the output should be:
----------
Date Total Previous_Total
12/2015 100 0 ----> 0 because no data before
01/2016 115 100 -----> this form total
02/2016 150 215 -----> 100 + 115
03/2016 180 365 -----> 100 + 115 + 150
----------
if i'm use record selection ex sample: {Class.date}>=Date("02/2016") And {Class.date}<=Date("03/2016")
i want to show in the report like this:
----------
Date Total Previous_Total
02/2016 150 215
----------

After trying 3 days, my case is done....
create group Date as "In specified order" then setting to "is in the period " and I'm selecting AllDatesFromToday (Position group is down column Page Header).
create group Total as "in ascending order" (Position group is up column Details).
Hide column details
insert Summary Date as "Maximum"
insert summary Total as "Sum"
drag max total to group Date, drag sum total to group Date
Finally create formula Previous_Total:
Sum ({MyClass.Total}, {MyClass.Date}, "daily")-{MyClass.Total}
Drag formula Previous_Total to group Date.
I try to test... Klik Menu Report, Selection Formulas, Record...
{MyClass.Date}<=date("02/2016")
Save, press F5 to refresh data and DONE...
Thank everybody for reply.... :)

Related

What's the smarter way to sum multiple data with same date and repeat for a month?

SO I have a few data with same date on google spreadsheet
Date Number
01/03/2021 3000
01/03/2021 2000
01/03/2021 1000
02/03/2021 500
05/03/2021 700
I would like to sum the number and sort it to the 01/03/2021 cell in another sheet
but how to sum all data in March without manually doing it for each day?
Date Number
01/03/2021 6000
02/03/2021 500
05/03/2021 700
thanks!!!
A basic GROUP BY query should yield the result you want:
SELECT Date, SUM(Number) AS Number
FROM yourTable
GROUP BY Date;

Creating a Separate Column for Prior Week Values (PostgreSQL)

How would I go about having a separate column that shows the prior week's value? For example, if Product A's value for 01/03/2021 was 100, I would like 01/10/2021 to show its date value as well as the 01/03/2021 value in a separate column.
Desired table below (for simplicity sake I added random numbers for the prior week values for 01/03 and 01/04):
Date
Product
Value
Prior Week Value
01/03/2021
Product A
100
50
01/04/2021
Product A
200
55
01/10/2021
Product A
600
100
01/11/2021
Product A
700
200
01/03/2021
Product B
250
40
01/04/2021
Product B
550
45
01/10/2021
Product B
460
250
01/11/2021
Product B
100
550
If you want exactly 7 days before, you can use window functions with a range specification:
select t.*,
max(value) over (partition by product
order by date
range between '7 day' preceding and '7 day' preceding
) as value_prev_week
from t;

How to Suppress Duplicate reocords in Total value for crystal report

This is Following details Called
For exam
Date type id acc amount
12/01/2 1 01 100 1000
12/01/2 2 02 200 3000
12/01/2 2 02 300 5000
Crystal report Total -----------------------
18000
But Actual Total for 9000 amount , How to solve issue
I tried in grouping also.
Pleas Help
Prakash
use the option Select Distinct Records in Database tab

automating account reconciliation in excel

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.

how to calculate % in PPS 2010

i have these columns in the table and made this table as the FACT table and also using time intelligence filter in the PPS2010..
i have measures , sum (materials), sum (sales) and sum (material_%)
in the PPS dashboard design i have included this cube and all the measures.. and using an analytic chart..
i have developed separate graphs for each columns (material, sales, material_%)..
for the sales and materials there is no problem , when i use the time filter
in the material_% graph i used the time filter current quarter in months (showing three months ) shows the correct value..
when i use the current quarter filter (sum of all the 3 months)
its showing 146% (83 +33 +30) --> for actual values
and 150 % ( 50+50+50) --> for target values
actually it showed show me 46% for actual and 50% for target ,
it should be sum of material in all the 3 months / sum of sales in all the 3 months but its just calculating sum of material_% column of all the 3 months
time filter : year :: Halfyear ::quarter:: Month::Day
DataBase Table:
Month Year Material sales Material_% [ material / sales]
Jan_Act 2011 500 600 83
Jan_target 2011 400 800 50
Feb_Act 2011 300 900 33
Feb_target 2011 300 600 50
Mar_Act 2011 300 900 30
Mar_target 2011 300 600 50
......
Jan_Act 2012 0 0 0
Jan_target 2012 600 1000 60
.............
Dec_Act 2012 0 0 0
Dec_target 2012 600 800 75
MDX Query:
SELECT
HIERARCHIZE( { [Time_dim].[Year - Half Year - Quarter - Month - Date].DEFAULTMEMBER } )ON COLUMNS,
HIERARCHIZE( { [Ven Bi Actfctmaster].[Act Fct].&[ACTUAL], [Ven Bi Actfctmaster].[Act Fct].&[TARGET] } )ON ROWS
FROM [Vin Finance]
WHERE ( [Measures].[Materials - Ven Bifullrptmaster] )
Please help me to sort out this issue.
i solved this issue by changing the measure of '%' columns from sum to averageofchild in the property tab..