Group Totals and row values to be repeated
All,
I have a data set like this
Category YearMonth Section Count1 Count2
Category1 201401 S1 15
5
Category1 201401 S2 10
0
Category1 201402 S1 5 5
Below is the result set that I want:
Category YearMonth Section %Count2
Category1 201401 S1 16.66% i.e. (5/30) * 100 (30, because if you
look at YearMonth 201401, I want to have a sum of 15 + 5 + 10 ))
Category1 201401 S2 (0/30) * 100 = 0%
Category1 201402 S1 (5/10) * 100 = 50% (Division by 10, coz the sum of counts for 201402 is 5 + 5)
Hi SqlCraze,
According to your description, you want to calculate a percentage of Count1 in Total Counts. Right?
In this scenario, we can set the detail rows group on YearMonth. Since we can specify scope for sum function, so we can get the total counts value for each group and calculate the percentage. please try the following expression:
=Fields!Count2.Value/(Sum(Fields!Count1.Value,"YearMonth")+Sum(Fields!Count2.Value,"YearMonth"))
We have tested this scenario, the design and result look like below:
Reference:
Sum Function (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou
Similar Messages
-
Weekly Group Total and associated YTD total
Hello,
I need to show current week group total and total year to date of the same group. My columns are Model, Department, Issue. Currently, the report is grouped on Model, Department and Issue with a filter for date. Can this be done? Thank youCreate a formula field, say {@Current Week Amount} as (basic syntax):
if datepart("ww", {datefield}) = datepart("ww", CurrentDate) then
formula = {amount}
else
formula = 0
end if
You can then sum() this, or place it in a detail line, or whatever. It will only have a (non-zero) value when the date field is in the current week.
HTH,
Carl -
Query generator used to make general total and row total
Dear experts/gurus,
I have a problem how to create general total and total field in row by using query generator. In inventory in warehouse report of SBO 2004A SP 00 PL 41, there are total row of price x quantity / warehouse (if selection criteria is warehouse) and general total. I have made query report that quite similar with inventory in warehouse report using query generator and put selection criteria and item but I still can't find out the solution. is it possible using query generator to do that or if I use query analyzer, what is the code that I have to put ? is it compute sum(qty x price) by itemcode or there is stil another ? i appreciate your answer. TIA
Rgds,Hi Jimmy,
Here's one approach to solve your problem:
= = = = = = =
select oitm.itemcode, oitm.itemname, whs.whscode, whs.quantity
from oitm inner join
(select itemcode, sum(onhand) as quantity, whscode from oitw group by itemcode, whscode) whs
on oitm.itemcode=whs.itemcode
= = = = = = =
...the main query refers to the subquery as it was another table. The subquery calculates quantity per warehouse from the oitw table.
Of course you could create a view in SQL Server instead of a subquery. That would make the query inside B1 query generator more simple and would also make it faster to execute.
Henry -
MR11 diferrence in total and sum value of line items
Hello
MR11 was run and it was exported to excel - it is found that there is a difference in value between the total figure given under the indivudual lines and the amount got by adding all the line items of the difference values. Can somebody please explain why this happens
The total figure matched with another report taken outside SAPExport to word
-
Query with group by and max value
Hi,
I have a table with many values of VAR_TRIMESTRALE for each COD_ISIN so I would take only the rows, for each COD_ISIN, that have the maximum of VAR_TRIMESTRALE.
select *
from spr_isin_drm_to b
group by b.COD_ISIN
having max(b.VAR_TRIMESTRALE)
I have tried to write the query in this way but it's wrong.
How can I write the correct query?
Thanks, bye bye.Hi,
This is an example of a "Top-N" query:
SELECT * -- or list, if you don't want to see r_num
FROM (
SELECT b.*
, RANK () OVER
( PARTITION BY cod_isin
ORDER BY var_trimestrale DESC
) AS r_num
FROM spr_isin_drm_to b
WHERE r_num = 1
; -
OBIEE - Calculated Measure and Row values.
Date Dimension = Dim Date
Location Dimension = Dim Unit
Fact Table = Fact Unit Svc Capacity
The image linked below illustrates my problem.
Combined screenshots
The top screenshot is from MS Excel and shows the expected data for May 2012. Columns: Civic Campus, Nursing Units(A1, A2 and A3), Average Daily Bed Quota and Monthly Bed Quota. Average Daily Bed Quota is derived from two columns: Bed Quota / Days of the Month. Monthly Bed Quota is derived from Bed Quota(with SUM aggregation). The calculated values shown are correct.
The second, third and fourth screenshots are from OBIEE Analytics for the same time index. Columns: Year(2012), Month(May), Campus(C), Nursing Unit(A1, A2 and A3), Average Daily Bed Quota and Monthly Bed Quota. The calculated values here should match the values in the Excel screenshot. Only the A1 Nursing Unit values match.
The fifth and final screenshot is from OBIEE Analytics for the same time index. The Days of Month column was added to the Compound Layout. In this screenshot, the Average Daily Bed Quota is being calculated correctly for each unit.
The Average Daily Bed Quota expression is only calculating Nursing Unit A1 correctly. I tried modifying the expression for my Days of Month logical column. In the alternate view, with Days of Month column, I can see the desired, calculated values. I'm not certain what is causing the error.
Edited by: 968521 on Oct 31, 2012 7:44 AM
Edited by: 968521 on Oct 31, 2012 7:46 AMYou need to have 'Is Prompted' for that specific measure. I would suggest to use action links on other columns instead of metrics.
Pls mark as correct/helpful if helps -
Help with Formula/Placeholder columns for group totals
I have select that is broken into 2 groups (a COMPANY group and a DETAIL group within company). I need to determine the COMPANY group totals based on values in a column in the DETAIL group. I.E. the column is a transaction description and can have up to 15 different values and it did not appear that a summary column would work for what I need. I have currently set up 15 formula columns in the DETAIL group and check the value of the REASON to accumulate totals and return the total to a PLACEHOLDER column (which is numeric and defined in the COMPANY group).
I then report the Placeholder columns at break of COMPANY. This all works fine if I run only one company. If I run with multiple companies the Placeholder columns are used as a running total.
My question is how do I reset the PLACEHOLDER columns at company break if at all, or is there a simpler way to accomplish what I need.
Any and all assistance would be greatly appreciated.
Tom VereeckeIf you are using one placeholder column in different formula columns just ignore the following solution. It will not work in that case. I will post it here if i find out any way to initialize placeholder columns at different groups or anyother way to solve this issue.
I think if you remove placeholder columns and create summary columns at Company Level, that will work. And formula columns will be changed as follows:
Formula Column:
active_total number(10) := 0;
begin
if :status_1 = 'ACTIVE' then
active_total := active_total + 1;
end if;
if :status_2 = 'ACTIVE' then
active_total := active_total + 1;
end if;
if :status_3 = 'ACTIVE' then
active_total := active_total + 1;
end if;
return active_total;
end;
And in summary columns source will be formula columns. And reset the summary columns at Company.
Hope this helps.
Message was edited by:
fs -
Urgent : how I get tree type group total result
hi master
sir now system give me this type for result
PARENT ACCID DRBAL CRBAL
K1
K11
11 K1101 46291132
11 K1102 13182173
11 K1103 23784045
11 K1104
11 K1105
11 K1106
11 K1107 10001795
11 K1108 9083529
11 K1109
11 K1110 4224350
11 K1111
11 K1112 6696832
11 K1113 7963381
11 K1114 742766
1 K12
12 K1201 1486082
12 K1202
12 K1203
1 K13
13 K1301
1301 K130101
1301 K130102
1301 K130103
1301 K130104 1977616
1301 K130105
1301 K130106 736266
1301 K130107 396673
1301 K130108 42751
1301 K130109 298362
1301 K130110 187696
1301 K130111 537
1301 K130112 942
1301 K130113 987
1301 K130114 1272
1301 K130115 40000
13 K1302
1302 K130201
1302 K130202
1302 K130203
1302 K130204
1302 K130205 259941
13 K1303
1303 K130301
1303 K130302
1303 K130303 177716
13 K1304
1304 K130401
1304 K130402
1304 K130403
1304 K130404
1304 K130405
1304 K130406 809719
1304 K130407
1304 K130408 1786091
13 K1305
1305 K130501
1305 K130502
13 K1306
1306 K130601
13 K1311
1311 K131101 788780
K2
2 K21
21 K2101
2101 K210101
2101 K210104
21 K2102
2102 K210201
2102 K210202
22 K2205
2205 K220501
2205 K220502
220502 K22050201
220502 K22050202
220502 K22050203
220502 K22050204
22 K2206
2206 K220601
2206 K220602
but sir i need this type of result
PARENT ACCID DRBAL CRBAL
GROUP NAME K1
GROUP NAME K11
11 K1101 46291132
11 K1102 13182173
11 K1103 23784045
11 K1104
11 K1105
11 K1106
11 K1107 10001795
11 K1108 9083529
11 K1109
11 K1110 4224350
11 K1111
11 K1112 6696832
11 K1113 7963381
11 K1114 742766
TOTAL
1 K12
TOTAL
GROUP NAME
12 K1201 1486082
12 K1202
12 K1203
TOTAL
1 K13
13 K1301
1301 K130101
1301 K130102
1301 K130103
1301 K130104 1977616
1301 K130105
1301 K130106 736266
1301 K130107 396673
1301 K130108 42751
1301 K130109 298362
1301 K130110 187696
1301 K130111 537
1301 K130112 942
1301 K130113 987
1301 K130114 1272
1301 K130115 40000
13 K1302
1302 K130201
1302 K130202
1302 K130203
1302 K130204
1302 K130205 259941
13 K1303
1303 K130301
1303 K130302
1303 K130303 177716
13 K1304
1304 K130401
1304 K130402
1304 K130403
1304 K130404
1304 K130405
1304 K130406 809719
1304 K130407
1304 K130408 1786091
13 K1305
1305 K130501
1305 K130502
13 K1306
Sir I need total group by group father group total and child group total
Please help me how I get tree type group total resultHi master
thankyou for your reply
Sir,
i know and you see my working i get code form master table and get detal amount form other table
I have two table see table
Acctab Baltab
PARENT PCID
CHILD title
PCID amount
I need heretical result use this type of query but not success
please see my query and give me idea how I get here full tree
select test.child,test.pcid,baltab.pcid from (select acctab.child,acctab.parent,acctab.pcid
from acctab
start with acctab.parent is null
connect by prior acctab.child= acctab.parent) test,baltab
where test.pcid=baltab.pcid ;
CHILD PCID PCID
1 1 1
2 2 2
3 3 3
11 111 111
12 112 112
13 113 113
21 221 221
22 222 222
23 223 223
31 331 331
32 332 332
33 333 333
but I need this type result
CHILD PCID
1 1
11 111
12 112
13 113
2 2
21 221
22 222
23 223
3 3
31 331
32 332
33 333 -
Group total amount in body margin
I have a group total amount and remark fields placed in the body margin. All the fields are inside a frame, which is set to "All Pages". And all the fields is set to "First Page".
My expected result is that the content will only show at the end of each group. But the fact is that, though they are all using "First Page", but the group total amount appears on every pages while the remark fields work!
Any idea? Thanks!the group total (and remark fields?) should be in a frame outside the grouping frame, not the margin.
-
Force the Summary Sub totals on same page as the Repeating Group
Hello folks,
I have a Group by Left Report where I am showing Patients and the Visits that they have taken for each Department.
I am then doing a Sub Total of the number of Visits the Patient has taken. I would like to make sure that the sub total shows
up on the same page as the data in the Repeating Group. I tried using an Anchor but the Report does not like it.
It gives an Error: REP 1213 - Field references column at a frequency below its group when I anchor from Repeating frame to the sub total footer
and REP 1814 Report cannot be formatted. Object 'Horizontally' can never fit within 'M_1' when I try to anchor the other way.
My goal is to show the Sub Totals (Total) on the same page as the Patient and not go to the next page. I have enclosed the single dashed line and the Total (Label and field) in a Frame.
Output of Report:
Patient ID Patient Name Department Visit
======================================================================
1001 Mary Poppins Department 001 3
Department 002 4
Department 003 1
Total 8
1002 Peter Pan Department 001 2
Department 002 1
Department 003 2
Total 5
-----------------------------Thanks in advance!Pls set the property(page protect of the frame containing both sub total and patient details) to yes.
-
How to get the first or last row value from a group using ntile
I want to query and use ntile to divide by data in 4 groups (quartiles). I got this part no problem and it returns the list of rows and the ntile bucket value for each one.
What I want though is to get only the first row from each ntile group (so in effect the max, q3, median, q1 and min values from the whole result). Of course I coud get max, min and median directly using the other functions, but how about the values for q3 and q1?
My query contains this:
NTILE(4) OVER (ORDER BY salary DESC NULLS LAST) as ntile
So I want the highest, lowest, middle, q3 and q1 values for the salaries.
Should I be using NTILE, ROWNUM, PERCENTIL_DIST....?
Any ideas? Thanks in advance.SQL> select ename,sal,
2 NTILE(4) OVER (ORDER BY sal DESC NULLS LAST) as ntile
3 from emp
4 /
ENAME SAL NTILE
KING 5000 1
FORD 3000 1
SCOTT 3000 1
JONES 2975 1
BLAKE 2850 2
CLARK 2450 2
ALLEN 1600 2
TURNER 1500 2
MILLER 1300 3
WARD 1250 3
MARTIN 1250 3
ENAME SAL NTILE
ADAMS 1100 4
JAMES 950 4
SMITH 800 4
14 rows selected.
SQL> select ename,
2 sal
3 from (
4 select ename,
5 sal,
6 ROW_NUMBER() OVER (PARTITION BY ntile ORDER BY sal DESC NULLS LAST) as rn
7 from (
8 select ename,
9 sal,
10 NTILE(4) OVER (ORDER BY sal DESC NULLS LAST) as ntile
11 from emp
12 )
13 )
14 where rn = 1
15 /
ENAME SAL
KING 5000
BLAKE 2850
MILLER 1300
ADAMS 1100
SQL> SY. -
Forecast horizon values are not being considered in Total demand row
Hello Experts,
We are in SCM 4.1 Version.
I have a question regarding Forecast horizon consderation in Planning book.
We have a weekly data view In our Planning book,and in that planning data view "Total demand" row is not calculating correctly for the products with Forecast horizon .
The entire Forecast is counted in Total demand without considering forecast horizon value for that Product.
But this is working fine for Daily data view.
I have also noticed that, Total demand values are calculating correcly in weekly view ( Forecast horizon value from the Product master is taken into account ) only when the Forecast horizon value crossing that week bucket.(i.e >7 days).
But usually we will have a Forecast horizon value of 3 days for all our products,.
What should we do to get the Total demand values correctly?
Thanks in advance..
SAPLOUIS.
Edited by: saplouis on Dec 5, 2010 6:42 AMCheck the macros on data view
Regards
Aban -
Totals Based on Multiple Criteria in Repeating Rows
Hi All,
I have 3 dropdowns (DD1, DD2, DD3) and one textfield (TF1) in repeating rows (not in a table). Each dropdown has two choices and the textfield is free-form. Outside of the rows (in a different subform) I want totals based on multiple criteria from the dropdowns and textfields.
The following script works great to get a total number of one choice from one dropdown.
this.rawValue = xfa.resolveNodes('form1.Form.row[*].DD1.[$.rawValue == "2"]').length;
Problem is how do I calculate the totals for the following based on the criteria listed in each row.
Find the totals for ML
Number of New Forms 1-2 Pages: (result should be 2)
Number of New Forms 3+ Pages: (result should be 1)
Number of Revised Form: (result should be 0)
In row #1: select “New” as a choice from DD1, “Form” as choice from DD2, “ML” as a choice from DD3 and enter “5” in TF1.
In row #2: select “New” as a choice from DD1, “Form” as choice from DD2 , “ML” as a choice from DD3 and enter “1” in TF1.
In row #3: select “New” as a choice from DD1, “Form” as choice from DD2, “ML” as a choice from DD3 and enter “2” in TF1.
In row #4: select “Revised” as a choice from DD1, “Series” as choice from DD2, “ML” as a choice from DD3 and enter “1” in TF1.
In row #5: select “New” as a choice from DD1, “Form” as choice from DD2, “PM” as a choice from DD3 and enter “1” in TF1.Try something like;
var mlNewForms1or2Pages = 0;
var mlNewFormsOver3Pages = 0;
var mlRevisedForms = 0;
var rows = xfa.resolveNodes('form1.Form.row[*]');
for (var i = 0, limit = rows.length; i < limit; i++)
var currentRow = rows.item(i);
if (currentRow.DD1.rawValue == "1") // new
if (currentRow.DD2.rawValue == "1") // form
if (currentRow.DD3.rawValue == "1") // ML
if (parseInt(currentRow.TF1.rawValue, 10) > 2)
mlNewFormsOver3Pages++;
else
mlNewForms1or2Pages++;
else // revised
if (currentRow.DD2.rawValue == "1") // form
if (currentRow.DD3.rawValue == "1") // ML
mlRevisedForms++
console.println(mlNewForms1or2Pages);
console.println(mlNewFormsOver3Pages);
console.println(mlRevisedForms);
To do the same using predicates you could do;
var mlNewForms1or2Pages = 0;
var mlNewFormsOver3Pages = 0;
var mlRevisedForms = 0;
mlNewForms1or2Pages = xfa.resolveNodes('form1.Form.row.[DD1 == 1 and DD2 == 1 and DD3 == 1 and TF1 <= 2]').length;
mlNewFormsOver3Pages = xfa.resolveNodes('form1.Form.row.[DD1 == 1 and DD2 == 1 and DD3 == 1 and TF1 > 2]').length;
mlRevisedForms = xfa.resolveNodes('form1.Form.row.[DD1 == 2 and DD2 == 1 and DD3 == 1]').length;
But if you wanted totals for all the permutations then this could become slow.
Regards
Bruce -
I have a requirement in report,
It should display totals in row and column wise,
Group open Close Total
A 10 5 15
B 15 10 25
Total 25 15 40
Thanks,
SriniSend me the template and xml file to [email protected] and I will take a look.
Thanks,
BIPuser -
Inserting total column and row
Hello All,
I'm new to WebI and BOBJ and I'm having some issue with my first report. I've tried searching the forum for this same issue (or something similar) and came across nothing. Any help is greatly appreciated!
I'm having a problem inserting a Grand Total column and row to my report. Here's a sample layout of my report:
*Tech Type | Project | Role | Key Fig1 | Key Fig 2 | Key Fig 3 | Key Fig 4|*
Proj 1
Subtot
Proj 2
Subtot
etc
In one tab the key figures are grouped by month and I also created four tabs (one tab for each key figure) that lists the key figures by month.
What I wish to do is insert one row at the end of the report which sums the key figures vertically and a column that adds the key figures horizontally. I've tried to do SUM but that inserts a row/column after every key fig. I've also tried to do a count and insert a SUM formula with the same effect (a row/column is inserted after every key figure).
Any suggestions?
Thanks,
Joaquim M.Joaquim,
Through your posting it's hard to visualize what is happening, other than you are not satisfied with the results. Here are the steps for adding a sum to a horizontal grid with perhaps two columns of information (month, figures). After the grid is presented, left-click once on the data of figures (do not click on the header cell of figures, click on any cell just below the header). Once you left-click the column will appear with a "grey" highligting. Next is to click on the "sigma" icon drop-down and choose "Sum". Once you click sum a new row at the very bottom of your grid should appear, summarizing [figures].
Thanks,
John
Maybe you are looking for
-
[SOLVED] My computer starts up too fast, breaking display startup
Xorg.0.log (which was logged with the last attempt to autostart lightdm at boot [ 2.948] X.Org X Server 1.16.3 Release Date: 2014-12-20 [ 2.948] X Protocol Version 11, Revision 0 [ 2.948] Build Operating System: Linux 3.18.1-1-ARCH x86_64 [ 2.948] Cu
-
Reg:Issue with PO & frieght for the Print output
Hi I have scenario I created a PO for a material which has 100 inr also the PO has got the frieght charges of 50 inr for different vendor Is there by any chance can i have the print for the both of these (material & frieght) seperately with same PO
-
What should I do ?
-
In PSE7 When I create and then view a slide show in full screen preview it will not refocus/resize as it does in the organizer when you go to full screen preview. When I tried to burn to CD it was also not in focus. Am I missing a step?
-
HT5622 apple id that comes up is not mine, how do i change it ?
CAN SOMEONE JUST HELP ME !?!?!