Sub totals& grand totals
Dear All,
I need to calculate sub totals then group totals and grand totals.
ex
x y z Val1 val2 val3
x1 y1 z1 10 20 30
x1 y1 z2 10 20 30
x1 y2 z3 10 20 30
Req Format
x y z Val1 val2 val3
x1 y1 z1 10 20 30
x1 y1 z2 10 20 30
y1 sum 20 40 60
x1 y2 z3 10 20 30
x1(sum) 30 60 90
for that one where i need to make changes while in query in data set Or in template
Awaiting for reply
Subbu...
Yes. I also wanna know how to do it. Would you pls point out an instruction for us? I read <<Oracle Business Intelligence Publisher B40017>> intensively. But I cann't find out any clue in it yet.
I'm very urgent. Can you tell us how to do it?
Similar Messages
-
How to get sub and grand total
Dear all, I have a report which combines the two totals together and and makes one formula. This formula then is filtered according to Group2 (Reason Code).
Group 1 is the same Reason Code however with Specified names. Group2 is the same reason code however with ascending order.
My question is how to make the sub total and grand total of this formula.
Detailed Information:
1: Total One - DistinctCount(Order_no),GroupName2 -- In this Total, the records are counted when Linetype = F
2: Total Two - DistinctCount(Order_no),GroupName2 -- In this Total, the records are counted when Linetype = S
Formula
Whileprintingrecords;
Numbervar x:=0;
Numbervar y:=0;
Numbervar z:=0;
x:={#FOCTC};
y:={#CREDITTC};
z:=x+y;
z;
Now this formula is placed in the footer of the Group2 (Reason Code).
What I would like to do is to have a Group2 Sub Total and Finally Grand Total.
I have tried the Following however it doesn't seem to be working.
I created another formula exactly like above and placed it into the same Group footer however removed the "Numbervar o:=0;" (The numbervar z:=0; in the above case however when I created another formula I created named the variable "o" instead of "z") so that it does not reset it.
Then I placed another formula into the Report Footer with the following code
Whileprintingrecords;
Numbervar o;
Any ideas?
Many thanks
Regards
JehanzebOk sorted, I used another formula like this.
Whileprintingrecords;
Numbervar TJGs;
Numbervar TotalJobs=0;
Numbervar CAvg=0;
TotalJobs := {@TotalFOCCR};
CAvg:= TotalJobs;
TJGs:=TJGs + CAvg;
CAvg
It sorted the issue. -
How to calculate Sub-Totals/Grand Totals on repeating row.
I have a this form that I need to calculate to produce a Sub-Total.... An end user can keep adding a line item but I would like to be able to add the amounts entered to calculate in a sub-total field. So basically, I need help with the actual script that would total the amount calculated from a Quantity*Amount which is -->"Sub Total" column then taking all of those to a new calculating script down to the "Sub-Total" field below it. I probably should rename them because its too similar.. I've tried the recommended scripts from the forums but just could not get it to work.
Excuse my editing...but this is what it looks like. If i need to clean it up so it looks more consistent please let me know if you have any advice. I just started working on acrobat forms 2 days ago and my eyes have gone blurry from reading the help forums
and here's the javascript on my "Sub-Total" (Which should probably be renamed to "Total" and my "Total" to "Grand Total". Any help would be much appreciated. Thanks!Try the LiveCycle Designer forums...
-
What's the best way to create sub-totals & grand-total in SQL2008 R2 (and beyond)?
What is the easiest way to get sub totals and a grand total on data that is being grouped? It looks like RollUp might work, but it's being depreciated.
My query is:
SELECT
COMPANY
,INVSTR_CD
,STATE_C
,SUM(CO_SHARE_TOTBAL) as CO_SHARE_TOTBAL
FROM #ASSET AS A
WHERE A.D_GETIT = 'Y'
GROUP BY COMPANY, STATE_C, INVSTR_CD
ORDER BY COMPANY, INVSTR_CD, STATE_C
I need to provide a sub-total of the SUM'd field (SUM(CO_SHARE_TOTBAL) as CO_SHARE_TOTBAL), at the change of the COMPANY field.
Then a Grand Total of all the SUM'd fields (SUM(CO_SHARE_TOTBAL).
Thanks in advance!!
-Al HIf you post DDL of your table (only relevant columns) and some data and desired output, I may try to reproduce it. Did you check Jacob's blog post and the very last query? It does take a few trials before getting this correct.
Naomi,
I did try the last query on Jacob's post. I couldn't get the first column to populate.
Thanks for the offer of help.
DML is:
Create Table #ASSET2 (
[COMPANY] [varchar] (5) NULL
,[INVSTR_CD] [varchar](5) NULL
,[STATE_C] [char](2) NULL
,[SHARE_TOTBAL] [decimal] (15,2) NULL)
Data is:
Insert into #ASSET2 VALUES ('00000','099 ','FL','115226.77')
Insert into #ASSET2 VALUES ('22222','030 ','CA','309899.43')
Insert into #ASSET2 VALUES ('00000','010 ','CA','524296.89')
Insert into #ASSET2 VALUES ('00000','099 ','IL','51699.70')
Insert into #ASSET2 VALUES ('00000','789 ','PA','90856.04')
Insert into #ASSET2 VALUES ('22222','010 ','CA','66951.33')
Insert into #ASSET2 VALUES ('00000','099 ','CA','310046.03')
Insert into #ASSET2 VALUES ('00000','010 ','AZ','178062.08')
Insert into #ASSET2 VALUES ('00000','099 ','NY','278489.10')
Desired results would be the following:
COMPANY INVSTR_CD STATE_C SHARE_TOTBAL
00000 010 AZ 178062.08
00000 010 CA 524296.89
00000 099 CA 310046.03
00000 099 FL 115226.77
00000 099 IL 51699.70
00000 099 NY 278489.10
00000 789 PA 90856.04
TOTAL COMPANY 00000 1548676.61
22222 010 CA 66951.33
22222 030 CA 309899.43
TOTAL COMPANY 22222 376850.76
GRAND TOTAL 1925527.37
-Al H -
Script: Sub totals & Grand Totals.(Urgent)
Hi Gurus
im developing a invoice billing. for this i need hw to get sub totals and grand totals at the last page in my main window . what should be given in the text elements and in the SE 38 part.please help me with this its very urgent.
correct answers are fully rewarded.
thanks in advance.
thanks & regards.
sirish.If you want your totals in fixed place than you need to create a new window and element inside it.
If you want just after the finishing of the main data than you can create a element in MAIN window and call it with the call FM WRITE_FORM.
Here is the small example:
DATA: W_SUM TYPE VBRP-NETWR.
START-OF-SELECTION.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'ZTEST_NP'
LANGUAGE = SY-LANGU.
DO 3 TIMES.
W_SUM = W_SUM + SY-INDEX. " << sum
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'MAIN'
WINDOW = 'MAIN'.
ENDDO.
* Fixed window for SUM
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'LAST'
WINDOW = 'LAST'.
IF SY-SUBRC <> 0.
ENDIF.
CALL FUNCTION 'CLOSE_FORM'
Regards,
Naimesh Patel -
Percentage in Totals / Grand Totals
I have 2 columns on a report (in reports builder) that have numbers - total touched & total count. I am calculating the percentage done with the following formula: ROUND(((PP_TOUCHED / PP_TOTAL) * 100),2). This works fine for the detail lines, but I can't get the correct percentage in the grand totals.
Also, when I use the above formula and one of the numbers is zero, I get an error.
KrisI have 2 columns on a report (in reports builder)
that have numbers - total touched & total count. I
am calculating the percentage done with the following
formula: ROUND(((PP_TOUCHED / PP_TOTAL) * 100),2).
This works fine for the detail lines, but I can't
get the correct percentage in the grand totals.How are you calculating the percentage for grand total? Create a formula column at report level and use summary columns in the formula to calculate percentage.
Also, when I use the above formula and one of the
numbers is zero, I get an error.
It may help:
ROUND(decode(nvl(PP_TOTAL,0),0,((PP_TOUCHED / PP_TOTAL) * 100)),2) -
Alv subtotals and grand total for a field
Hi friends,
I Have an internal table ITAB1
in that i have a senario as below.
In my GRID display iam getting values in the layou as follows
BUKRS = 1000
LIFNR MATNR STCST
100 abc 500,00
100 pqr 400,00
100 xyz 200,00
sub total
200 pto 700,00
200 vbr 900,00
sub total
BUKRS = 2000
LIFNR MATNR STCST
150 abc 500,00
150 pqr 400,00
150 xyz 200,00
sub total
260 pto 700,00
260 vbr 900,00
sub total
GRAND TOTAL =
Now my requirement is at the end of every vendor i need sub total for STCST field.
and at the end of every company code i need GRAND TOTAL for STCST field.
Its alv grid display.
how can i do that.
Regards,
Priyanka.Check this sample code may it will help u:
*& Report Z_ALV_SUBTOTAL
REPORT z_alv_subtotal.
*& Table declaration
TABLES: ekko.
*& Type pool declaration
TYPE-POOLS: slis. " Type pool for ALV
*& Selection screen
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
*& Type declaration
* Type declaration for internal table to store EKPO data
TYPES: BEGIN OF x_data,
ebeln TYPE char30, " Document no.
ebelp TYPE ebelp, " Item no
matnr TYPE matnr, " Material no
matnr1 TYPE matnr, " Material no
werks TYPE werks_d, " Plant
werks1 TYPE werks_d, " Plant
ntgew TYPE entge, " Net weight
gewe TYPE egewe, " Unit of weight
END OF x_data.
*& Internal table declaration
DATA:
* Internal table to store EKPO data
i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
* Internal table for storing field catalog information
i_fieldcat TYPE slis_t_fieldcat_alv,
* Internal table for Top of Page info. in ALV Display
i_alv_top_of_page TYPE slis_t_listheader,
* Internal table for ALV Display events
i_events TYPE slis_t_event,
* Internal table for storing ALV sort information
i_sort TYPE slis_t_sortinfo_alv,
i_event TYPE slis_t_event.
*& Work area declaration
DATA:
wa_ekko TYPE x_data,
wa_layout TYPE slis_layout_alv,
wa_events TYPE slis_alv_event,
wa_sort TYPE slis_sortinfo_alv.
*& Constant declaration
CONSTANTS:
c_header TYPE char1
VALUE 'H', "Header in ALV
c_item TYPE char1
VALUE 'S'.
*& Start-of-selection event
START-OF-SELECTION.
* Select data from ekpo
SELECT ebeln " Doc no
ebelp " Item
matnr " Material*
matnr " Material*
werks " Plant*
werks " Plant*
ntgew " Quantity
gewei " Unit
FROM ekpo
INTO TABLE i_ekpo
WHERE ebeln IN s_ebeln
AND ntgew NE '0.00'.
IF sy-subrc = 0.
SORT i_ekpo BY ebeln ebelp matnr .
ENDIF.
* To build the Page header
PERFORM sub_build_header.
* To prepare field catalog
PERFORM sub_field_catalog.
* Perform to populate the layout structure
PERFORM sub_populate_layout.
* Perform to populate the sort table.
PERFORM sub_populate_sort.
* Perform to populate ALV event
PERFORM sub_get_event.
END-OF-SELECTION.
* Perform to display ALV report
PERFORM sub_alv_report_display.
*& Form sub_build_header
* To build the header
* No Parameter
FORM sub_build_header .
* Local data declaration
DATA: l_system TYPE char10 , "System id
l_r_line TYPE slis_listheader, "Hold list header
l_date TYPE char10, "Date
l_time TYPE char10, "Time
l_success_records TYPE i, "No of success records
l_title(300) TYPE c. " Title
* Title Display
l_r_line-typ = c_header. " header
l_title = 'Test report'(001).
l_r_line-info = l_title.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR l_r_line.
* Run date Display
CLEAR l_date.
l_r_line-typ = c_item. " Item
WRITE: sy-datum TO l_date MM/DD/YYYY.
l_r_line-key = 'Run Date :'(002).
l_r_line-info = l_date.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR: l_r_line,
l_date.
ENDFORM. " sub_build_header
*& Form sub_field_catalog
* Build Field Catalog
* No Parameter
FORM sub_field_catalog .
* Build Field Catalog
PERFORM sub_fill_alv_field_catalog USING:
'01' '01' 'EBELN' 'I_EKPO' 'L'
'Doc No'(003) ' ' ' ' ' ' ' ',
'01' '02' 'EBELP' 'I_EKPO' 'L'
'Item No'(004) 'X' 'X' ' ' ' ',
'01' '03' 'MATNR' 'I_EKPO' 'L'
'Material No'(005) 'X' 'X' ' ' ' ',
'01' '03' 'MATNR1' 'I_EKPO' 'L'
'Material No'(005) ' ' ' ' ' ' ' ',
'01' '04' 'WERKS' 'I_EKPO' 'L'
'Plant'(006) 'X' 'X' ' ' ' ',
'01' '04' 'WERKS1' 'I_EKPO' 'L'
'Plant'(006) ' ' ' ' ' ' ' ',
'01' '05' 'NTGEW' 'I_EKPO' 'R'
'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.
ENDFORM. " sub_field_catalog
*& Form sub_fill_alv_field_catalog
*& For building Field Catalog
*& p_rowpos Row position
*& p_colpos Col position
*& p_fldnam Fldname
*& p_tabnam Tabname
*& p_justif Justification
*& p_seltext Seltext
*& p_out no out
*& p_tech Technical field
*& p_qfield Quantity field
*& p_qtab Quantity table
FORM sub_fill_alv_field_catalog USING p_rowpos TYPE sycurow
p_colpos TYPE sycucol
p_fldnam TYPE fieldname
p_tabnam TYPE tabname
p_justif TYPE char1
p_seltext TYPE dd03p-scrtext_l
p_out TYPE char1
p_tech TYPE char1
p_qfield TYPE slis_fieldname
p_qtab TYPE slis_tabname.
* Local declaration for field catalog
DATA: wa_lfl_fcat TYPE slis_fieldcat_alv.
wa_lfl_fcat-row_pos = p_rowpos. "Row
wa_lfl_fcat-col_pos = p_colpos. "Column
wa_lfl_fcat-fieldname = p_fldnam. "Field Name
wa_lfl_fcat-tabname = p_tabnam. "Internal Table Name
wa_lfl_fcat-just = p_justif. "Screen Justified
wa_lfl_fcat-seltext_l = p_seltext. "Field Text
wa_lfl_fcat-no_out = p_out. "No output
wa_lfl_fcat-tech = p_tech. "Technical field
wa_lfl_fcat-qfieldname = p_qfield. "Quantity unit
wa_lfl_fcat-qtabname = p_qtab . "Quantity table
IF p_fldnam = 'NTGEW'.
wa_lfl_fcat-do_sum = 'X'.
ENDIF.
APPEND wa_lfl_fcat TO i_fieldcat.
CLEAR wa_lfl_fcat.
ENDFORM. " sub_fill_alv_field_catalog
*& Form sub_populate_layout
* Populate ALV layout
* No Parameter
FORM sub_populate_layout .
CLEAR wa_layout.
wa_layout-colwidth_optimize = 'X'." Optimization of Col width
ENDFORM. " sub_populate_layout
*& Form sub_populate_sort
* Populate ALV sort table
* No Parameter
FORM sub_populate_sort .
* Sort on material
wa_sort-spos = '01' .
wa_sort-fieldname = 'MATNR'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
* Sort on plant
wa_sort-spos = '02'.
wa_sort-fieldname = 'WERKS'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
ENDFORM. " sub_populate_sort
*& Form sub_get_event
* Get ALV grid event and pass the form name to subtotal_text
* event
* No Parameter
FORM sub_get_event .
CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
'SUBTOTAL_TEXT'.
DATA: l_s_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 4
IMPORTING
et_events = i_event
EXCEPTIONS
list_type_wrong = 0
OTHERS = 0.
* Subtotal
READ TABLE i_event INTO l_s_event
WITH KEY name = slis_ev_subtotal_text.
IF sy-subrc = 0.
MOVE c_formname_subtotal_text TO l_s_event-form.
MODIFY i_event FROM l_s_event INDEX sy-tabix.
ENDIF.
ENDFORM. " sub_get_event
*& Form sub_alv_report_display
* For ALV Report Display
* No Parameter
FORM sub_alv_report_display .
DATA: l_repid TYPE syrepid .
l_repid = sy-repid .
* This function module for displaying the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_top_of_page = 'SUB_ALV_TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = i_fieldcat
it_sort = i_sort
it_events = i_event
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = i_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE i000 WITH 'Error in ALV report display'(055).
ENDIF.
ENDFORM. " sub_alv_report_display
* FORM sub_alv_top_of_page
* Call ALV top of page
* No parameter
FORM sub_alv_top_of_page. "#EC CALLED
* To write header for the ALV
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_alv_top_of_page.
ENDFORM. "alv_top_of_page
*& Form subtotal_text
* Build subtotal text
* P_total Total
* p_subtot_text Subtotal text info
FORM subtotal_text CHANGING
p_total TYPE any
p_subtot_text TYPE slis_subtot_text.
* Material level sub total
IF p_subtot_text-criteria = 'MATNR'.
p_subtot_text-display_text_for_subtotal
= 'Material level total'(009).
ENDIF.
* Plant level sub total
IF p_subtot_text-criteria = 'WERKS'.
p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
ENDIF.
ENDFORM. "subtotal_text
Edited by: Joyjit Ghosh on Aug 21, 2008 5:25 PM -
Subtotal / Grand total not working
I am new to OBIEE & I could not get a simple 'Total By' or 'Grand Total' in Answers, Table view. The default aggregation rule in Administrator is selected as 'Sum'. When I click on the 'E' summation icon, nothing happens. What am I missing?
Thanks,
Dinesh.OK. I figured out what was wrong. I did not put the logical schema in a star schema approach (dimensions & facts). Once I did that, the sub-totals & grand totals started working.
But I am greatly disappointed by this limitation. I just have a copy of my transactional database & I do not want to do star schema data modelling so that I can quickly start reporting. Is there any work-around for this?
Thanks,
Dinesh. -
Help regarding how to show total and grand total
hi all
please help me to show the total / grand total fund wise
i m giving final output that i want
which functions may i use .
following is my query
SELECT MUT_NAME , NATURE , BROK_TYPE ,sum(BROKERAGE) brokerage FROM (
SELECT MUT_NAME , NATURE , BROK_TYPE ,BROKERAGE FROM (
select mf.mut_name , si.nature ,'UPFRONT' BROK_TYPE , sum(up1.paid_brok) BROKERAGE from upfront_paid up , upfront_paid_dtl upd , upfront_pr up1 , scheme_info si , mut_fund mf
where up.slab_id = upd.slab_id
and up.SLAB_ID = up1.paid_slab_id
and up.sch_code = si.sch_code
and si.mut_code = mf.mut_code
-- and si.mut_code = 'MF004'
group by grouping sets ( (mf.mut_name , si.nature) ) ROLLUP(MF.MUT_NAME,SI.NATURE)
UNION ALL
select mf.mut_name , si.nature ,'TRAIL' BROK_TYPE , sum(up1.paid_brok) BROKERAGE from TRAIL_paid up , TRAIL_paid_dtl upd , TRAIL_pr up1 , scheme_info si , mut_fund mf
where up.slab_id = upd.slab_id
and up.SLAB_ID = up1.paid_slab_id
and up.sch_code = si.sch_code
and si.mut_code = mf.mut_code
-- and si.mut_code = 'MF004'
group by grouping sets ( (mf.mut_name , si.nature) ) ) ROLLUP(MF.MUT_NAME,SI.NATURE)
UNION ALL
SELECT 'TOTAL ' MUT_NAME , ' ' NATURE , ' ' BROK_TYPE ,SUM(BROKERAGE) FROM (
select mf.mut_name , si.nature ,'UPFRONT' BROK_TYPE , sum(up1.paid_brok) BROKERAGE
from upfront_paid up , upfront_paid_dtl upd , upfront_pr up1 , scheme_info si , mut_fund mf
where up.slab_id = upd.slab_id
and up.SLAB_ID = up1.paid_slab_id
and up.sch_code = si.sch_code
and si.mut_code = mf.mut_code
--and si.mut_code = 'MF004'
group by grouping sets ( (mf.mut_name , si.nature) ) ROLLUP(MF.MUT_NAME,SI.NATURE)
UNION ALL
select mf.mut_name , si.nature ,'TRAIL' BROK_TYPE , sum(up1.paid_brok) BROKERAGE from TRAIL_paid up , TRAIL_paid_dtl upd , TRAIL_pr up1 , scheme_info si , mut_fund mf
where up.slab_id = upd.slab_id
and up.SLAB_ID = up1.paid_slab_id
and up.sch_code = si.sch_code
and si.mut_code = mf.mut_code
-- and si.mut_code = 'MF004'
group by grouping sets ( (mf.mut_name , si.nature) ) ) ROLLUP(MF.MUT_NAME,SI.NATURE)))
GROUP BY grouping sets (MUT_NAME),( NATURE ),( BROK_TYPE)
ORDER BY MUT_NAME , NATURE , BROK_TYPE
Sl. No. Fund House Fund Type Brokerage Type "Type-wise
Commission " Gross Commission
(1) Fidelity Mutual Fund Equity Upfront Commission xxx
Trail xxx
Others xxx
Debt Upfront Commission xxx
Trail xxx
Others xxx
T O T A L : xxxxx
(2) Franklin Templeton Mutual Fund Equity Upfront Commission
Trail
Per Form
AUM Linked
SIP Advance Annual Brokerage
Others
Debt Upfront Commission
Trail
Others
T O T A L : xxxxx
CONSOLIDATED TOTAL COMMISSION : xxxxxany help appriciated.how can i use compute in procedure
actually i am giving the output from query to ref_cursor and from front end ( .NET) they are fetch rows and show the output.
i want output as fallows
fund name -- nature --- brok type --- brokerage
1] fidelity equity upfront 2000
equity trail 1000
debth upfront 1500
debth trail 500
Fidelity 5000
2] abc --
so on hope this clears you
Message was edited by:
Pankaj M -
Sub total wise Grand total in ALV report
Dear All,
I am displaying a list of material through material group wise so for each material i want to display sub-total for stock and grand total of stock(material group wise).Here it is adding up all the stock displayed for different AUOM(alternative unit of measure ) which is for same material so i want to pick only the sub-total and sum up in my Grand total.
How to pick only the Sub-total Results and Add in ALV List for Grand total.
Thanks & Regards,
Arun.
Edited by: Arun Kumaran on Sep 24, 2008 7:46 AMHi arun,
check these links
total and subtotal in alv
ALV SUBTOTAL
Regards,
Anirban -
Hide grand total field on ALV report, But keep the sub total fields
Dear Experts,
1) How to hide grand total field on ALV report, But keep the sub total fields.
2) How to populate rate per ton & calculate total price according to the qty in delivering document.Dear Experts,
1) How to hide grand total field on ALV report, But keep the sub total fields.
2) How to populate rate per ton & calculate total price according to the qty in delivering document. -
How to create a sub total and grand total using my query.
How can I create a sub total for each section and grand total for using my query like this. your help is appreciated. I am working with 9g
WITH BidItemsInformation AS
( SELECT DISTINCT q.iplineno "Line Number", q.section "Section Number",
i.item "Item Number",
initcap(i.idescr) "Description" ,
i.iunits "Unit",
q.qty "Quantity" ,q.price "Engineers Unit Price",
(q.price * q.qty) "Engineers Estimate"
FROM letprop l,
proposal p,
propitem q,
bidlet b,
bidtabs c,
itemlist i,
vendor v,
bidders d
WHERE(l.letting = b.letting
And b.letting = c.letting
And p.cspecyr = i.ispecyr)
AND q.prpitem = i.item
AND p.contid = l.lcontid
AND q.contid = p.contid
AND c.vendor = l.avendor
AND l.CALL = c.CALL
AND q.lineflag = c.lineflag
AND q.iplineno = c.iplineno
AND l.letting = d.letting
AND c.letting = l.letting
AND c.CALL = d.CALL
AND v.vendor = d.vendor
-- AND AND l.letstat = 'A'
AND c.lineflag = 'L'
AND l.letting ='&letting'
AND l.CALL = '&call'
), BiddersInformation AS
-- This is where you make your changes for vendor name and vendor number Do not touch the above code
-- It is always the same for any call number and letting date
( SELECT IPLINENO "BLine Number",
MAX(CASE WHEN VENDOR='K020' THEN bidprice ELSE NULL END) "K020:: Unit Price",
MAX(CASE WHEN VENDOR='K020' THEN bidprice ELSE NULL END) K,
MAX(CASE WHEN VENDOR='H438' THEN bidprice ELSE NULL END) "H438:: Unit Price",
MAX(CASE WHEN VENDOR='H438' THEN bidprice ELSE NULL END) H,
MAX(CASE WHEN VENDOR='U010' THEN bidprice ELSE NULL END) "U010:: Unit Price",
MAX(CASE WHEN VENDOR='U010' THEN bidprice ELSE NULL END) U,
MAX(CASE WHEN VENDOR='G110' THEN bidprice ELSE NULL END) "G110:: Unit Price",
MAX(CASE WHEN VENDOR='G110' THEN bidprice ELSE NULL END) G,
MAX(CASE WHEN VENDOR='H530' THEN bidprice ELSE NULL END) "H530:: Unit Price",
MAX(CASE WHEN VENDOR='H530' THEN bidprice ELSE NULL END) H1
FROM BIDTABS
WHERE LETTING='&letting'
AND CALL='&call'
AND BIDPRICE <> 0
GROUP BY IPLINENO
SELECT BidItemsInformation."Line Number",
BidItemsInformation."Section Number",
BidItemsInformation."Item Number",
BidItemsInformation."Description",
BidItemsInformation."Unit",
BidItemsInformation."Quantity",
BidItemsInformation."Engineers Unit Price",
BidItemsInformation."Engineers Estimate",
BiddersInformation."K020:: Unit Price",
(BidItemsInformation."Quantity" * K) "KGM CONTRACTORS INC",
BiddersInformation."H438:: Unit Price",
(BidItemsInformation."Quantity" * H) "HOFFMAN CONSTRUCTION COMPAN",
BiddersInformation."U010:: Unit Price",
(BidItemsInformation."Quantity" * U) "ULLAND BROTHERS INC",
BiddersInformation."G110:: Unit Price",
(BidItemsInformation."Quantity" * G) "GLADEN CONSTRUCTION INC",
BiddersInformation."H530:: Unit Price",
(BidItemsInformation."Quantity" * H1) "HOOVER CONSTRUCTION CO"
FROM BidItemsInformation,BiddersInformation
WHERE BidItemsInformation."Line Number" = BiddersInformation."BLine Number";
Line Number Section Number Item Number Description Unit Quantity Engineers Unit Price Engineers Estimate K020:: Unit Price
0010 0001 2011601/00003 Construction Surveying LS 1 143,000 143,000 75,000 75,000 67,080 67,080
0013 0001 2013601/00010 Survey Equipment LS 1 25,000 25,000 25,000 25,000 30,000 30,000
0020 0001 2015601/00030 Blast Monitor/Survey LS 1 50,000 50,000 30,000 30,000 35,000 35,000
0030 0001 2021501/00010 Mobilization LS 1 382,250 382,250 809,000 809,000 704,000 704,000
0040 0001 2021602/00010 Well Survey EACH 60 500 30,000 2,150 129,000 1,600 96,000
0050 0001 2031501/00040 Field Office Type D EACH 1 6,367 6,367 4,000 4,000 25,000 25,000
sub total:
1610 0002 2401501/01143 Structural Concrete (1a43) C Y 46 350 16,100 408 18,768 400 18,400
1620 0002 2401501/01362 Structural Concrete (1c62) C Y 68 200 13,600 204 13,872 200 13,600
1630 0002 2401501/03643 Structural Concrete (3y43) C Y 60 600 36,000 592 35,520 580 34,800
1640 0002 2401512/03633 Bridge Slab Concrete (3y33) S F 1,876 24 45,024 28 51,778 27 50,652
1650 0002 2401521/00030 Structure Excavation Class R C Y 17 125 2,125 1,000 17,000 500 8,500
1660 0002 2401541/00010 Reinforcement Bars LB 2,490 2 3,735 1 3,312 1 3,237
1670 0002 2401541/00011 Reinforcement Bars (Epoxy Coated) LB 12,380 2 18,570 1 17,703 1 17,332
1680 0002 2401601/00010 Structure Excavation LS 1 2,500 2,500 2,000 2,000 5,000 5,000
1690 0002 2402583/00020 Ornamental Metal Railing Type Special L F 284 150 42,600 194 55,096 190 53,960
sub total
1820 0003 2401513/00346 Type Curb Railing Concrete (3y46) L F 135 25 3,375 16 2,093 15 2,025
1830 0003 2401513/07447 Type Mod P-4 (Tl-4) Railing Conc (3y46) L F 302 85 25,670 72 21,593 70 21,140
1840 0003 2401541/00010 Reinforcement Bars LB 14,780 1 18,475 1 13,598 1 13,302
1850 0003 2401541/00011 Reinforcement Bars (Epoxy Coated) LB 76,720 1 103,572 1 85,926 1 84,392
1860 0003 2401601/00010 Structure Excavation LS 1 10,000 10,000 116,000 116,000 115,000 115,000
1870 0003 2402583/00020 Ornamental Metal Railing Type Special L F 132 150 19,800 184 24,288 180 23,760
sub total
totalYou can accomplish that using decode with the grouping function. It returns 1 when that column passed as argument was grouped (or is in some total) and 0 otherwise.
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> with t as
2 (select 'New York' city, 'US' country, 1 num from dual
3 union all select 'Los Angeles' city, 'US' country, 2 num from dual
4 union all select 'London' city, 'GB' country, 2 num from dual
5 union all select 'London' city, 'GB' country, 2 num from dual
6 union all select 'London' city, 'GB' country, 7 num from dual)
7 select decode(grouping(country), 0, country, 'GRAND TOTAL') country,
8 decode(grouping(city), 0, city, decode(grouping(country), 0, 'SUBTOTAL')) city,
9 sum(num) num_total
10 from t
11 group by rollup(country, city)
12 /
COUNTRY CITY NUM_TOTAL
GB London 11
GB SUBTOTAL 11
US New York 1
US Los Angeles 2
US SUBTOTAL 3
GRAND TOTAL 14
6 linhas selecionadas.
SQL> -
Urgent : how to calculate sub total and grand total in smart forms
Hi Friens..how to calculate sub total and grand total in smart forms..How to print them in smart forms...Also kindly explain how to handle events in smart forms..Thanks in advance
Re: Subtotal with Table Node in smartforms
-
Am getting SUB TOTALS. But, I do NOT wanna show up the GRAND TOTALS in ALV
Hi Experts,
Am getting Sub Totals(line in dim yellow color) for my_alv report.........fine.
But, for some reason, I do NOT wanna to show up the GRAND TOTALS(line in dark yellow color) for my_alv!!
So, pls. let me know, How to get it done?
thanqhi Srinivas,
is_layout-no_totalline = 'X'.
hope this helps
ec -
Page break,sub total and grand total in adobe forms
hi,
In adobe forms, i am displaying purchase order details in table format. internal table contains 150 records but it displaying
only 50 records in single page. how i have to call a new page,how i have to create a page preak and i want to display only
5 records for a page with carry forward,page total and total net value.Hi Sivaprasath,
For the table content to flow onto the next pages please make sure that the outermost subform is NOT with the content property "Positioned".
For having only 5 records per page, you can design a deep structure with fields:
Table 1 (The table which will hold 5 records per page)
Page total
total net value
Have the table type of it defined in the form.
Put the logic for filling the table in such a way that each row of this nested table has 5 records and pagetotal and total net value.
then put it inside a subform and check the checkbox for "rpeat subformt for each data item".
Another way is to use Conditional breaks in Pagination tab.
Thanks and regards,
Priyanka
Maybe you are looking for
-
Dear All, What are the settings required for automatic generation of inspection lot for co-product? e.g. Production order for material ' X '. BOM items are Y and Z. Z is a co-product. On release of production order for material X inspection lot is au
-
Reorganizing in Photoshop Elements Organizer 11
I want to import photos from a file on my computer into Photoshop Organizer 11 and REORGANIZE them. Once they are in there, I want to move some photos in front of others- chronologically- from 2-3 different cameras and then BATCH RENAME them all acco
-
Clearing Network Identification Property List
How do I go about clearing the network identification property list? /Library/Preferences/SystemConfiguration/com.apple.network.identification.plist I have tried deleting it, but it always regenerates with the same data. I want the property list to j
-
Launching AIR application When Operating system starts
Hi I want to lauch my AIR application automatically when windows operating system starts. How can i solve this problem. Thanks in advance to all Regards sss
-
Unable to create or remove VLAN
I'm unable to create or remove any VLAN on my cisco switch... C2950 Software (C2950-I6K2L2Q4-M), Version 12.1(22)EA6 Error: APP-SW-LAN-CISCO-#5(config)#no vlan 10 Error on initialize VLAN database 1: VTP feature not yet initialized when i give "show