Display Columns having sum/total not zero
We have a report that hav total twenty columns.
Each time we run te report (dynamic query) random columns have sum=zero
we want to display eachtime only the columns having sum greater than zero.
regards
jazib
Hi Jazib,
Ok - I've been testing this here [http://htmldb.oracle.com/pls/otn/f?p=267:43]. The report on the left shows/hides the SAL and COMM columns according to the totals. The report on the right shows the full data. Change the Dept to see this in effect.
There are other methods available, but this is what I have done:
The dept select list (item name is P43_DEPTNO) is just a list of departments and a NULL option that returns 0 (zero).
The report's source is a SQL statement of:
SELECT EMPNO, ENAME, SAL, COMM
FROM EMP
WHERE :P43_DEPTNO = 0 OR :P43_DEPTNO = DEPTNO
ORDER BY ENAMEI have a region in the After Header position that uses "No Template" and contains two Hidden items - P43_SAL and P43_COMM.
I have an Item Computation, running "Before Header", that sets P43_DEPTNO to 0 if it is NULL.
I have an unconditional PL/SQL Process, running "On Load - Before Header", that has the following process code:
DECLARE
vSAL NUMBER;
vCOMM NUMBER;
BEGIN
SELECT NVL(SUM(SAL),0), NVL(SUM(COMM),0)
INTO vSAL, vCOMM
FROM EMP
WHERE :P43_DEPTNO = 0 OR :P43_DEPTNO = DEPTNO;
:P43_SAL := vSAL;
:P43_COMM := vCOMM;
END;And, finally, on the SAL column in the report, I have set the Condition Type to "Value of Item in Expression 1 != Zero" and Expression 1 is: P43_SAL. And the same on the COMM column, but Expression 1 is: P43_COMM
When the page is loaded, the process is run and the totals for SAL and COMM are calculated and inserted into P43_SAL and P43_COMM. The report is then run and the conditions check the values of these two hidden items - if either is non-zero, then the column is displayed.
Andy
Similar Messages
-
Conditionally displayed columns of interactive report not displayed
We have an interactive report in which few of the columns have been defined with conditions for display.
But on the interactive report page, when the conditions are satisfied these columns do not display in the report by default.
These columns are found in the 'Select Columns' -> 'do not display' pane. Everytime the report is run, these columns need to be selected using the select column.
Is there anyway to make the columns appear in the report by default, when conditions are true.Thanks Jari for your help.
For this issue, we finally came up with a work around.
we removed the conditions from all the columns then ran the application report page.
Clicked on Select Columns and moved the columns from the do not display pane to the right pane.
Ordered them as needed. Then saved the report as primary.
Then again went to the edit page-> interactive report and applied the conditions to the necessary columns.
and it worked.
When I went to the report these columns are displayed by default. -
Total Score in Sum Total not correct
We are using Captivate 4 and the Sum Total LMS. Our course consists of 2 lessons which are not scored and an assessment which is scored. The settings for the lessons are Slide Views Only so the lessons have the Topic Status Complete or Incomplete on the Sum Total LMS Learning Activity Progress Detail page, with the Score % blank. The assessment also has Topic Status Complete or Incomplete, and also a Score % (80% required to pass). The Topic Status and Score % values are correct for the lessons and the assessment, however the Total Score is not correct. When the user completes the 2 lessons and the assessment with a score of 100%, the Total Score shows as only 33%. So it seems that Sum Total is including the lessons in the Total Score, and calculating the Total Score by (100+0=0)/3 = 33%, i.e. assigning 0% to the lessons even though the Score % is blank for the lessons.
Is there a way to have the Total Score be just for the assessment? If the user scores 100% on the assessment we would like the Total Score to be 100%.Hi,
Can you make your question more clear, it is not clear what is you requirement exactly.
'.Total stock not issued from gate in stock.' : Yuou mean to say GR made with 103 but 105 not done for that
or Total stock in store but not issued yet ) : there is no GI with any movemen type ??
regards,
zafar -
Expense Report Summary page does not show any totals - only zeros
Hi All,
On creation of Expense Report in the portal When entering a billable expense report, when you get to the summary page is does not show any totals - only zeros for other two schema's its working fine like displaying totals
we are surprised that any custom development is hitting or anything relates with configuration
Provide valuable inputs to proceed further
Regards
JaipalHello vetsrini.
Thanks a lot for your kind reply. As i said, i'm new to this and sometimes i just cannot pass over some problems. Here are the fields i have inserted:
<?for-each:LIST_G_SETUP/AS_OF_DATE?>
<?end for-each?>
<?for-each@section:G_CUST_INV?>
<?for-each:G_1?>
<?INVNUM?>
<?INVOICE_TYPE_INV?>
<?DUE_DATE_INV?>
<?sum (C_INV_BALANCE)?>
<?sum (C_INV_B0)?>
<?sum (C_INV_B1)?>
<?sum (C_INV_B2)?>
<?sum (C_INV_B3)?>
<?sum (C_INV_B4)?>
<?sum (C_INV_B5)?>
<?end-for-each-group?>
<?TOTAL_INV_AMT_DSP?>
<?TOTAL_INV_B0_DSP?>
<?TOTAL_INV_B1_DSP?>
<?TOTAL_INV_B2_DSP?>
<?TOTAL_INV_B3_DSP?>
<?TOTAL_INV_B4_DSP?>
<?TOTAL_INV_B4_DSP?>
<?end for-each:G_CUST_INV?>
In the header of the template i also have <?CUST_NAME_INV?> and the report date. When i try to enter the <?AS_OF_DATE?> it is not printed and also the header is not shown any longer. Once again, thank you for any help,
Octavio -
There is an error in the sum total displayed in infoty type 8.
Hi,
In infotype 8 there is an error in the sum total . Recently few wage types were added in the system.
Now the total amount of all the wagetypes is not displayed correct.
please tell me is there any functional aspect through which it can be corrected.2BAS Basic Salary 30.964,00 INR
2HRA House Rent Allowance 15.482,00 INR
2SPL Special Allowance 871,00 INR
1LTA Leave Travel All. (CTC) 2.580,00 INR
1DRI Driver's Pay Reimb. (CTC) 6.000,00 INR
1MED Medical Reimb. (CTC) 1.250,00 INR
1PET Petrol Reimb. (CTC) 4.000,00 INR
1GRA Gratuity (CTC) 1.489,00 INR
1LEN Leave Encashment (CTC) 300,00 INR
1BON Bonus(CTC) 6.881,00 INR
1IMC Medical Insurance (CTC) 179,00 INR
IV 24.10.2008 - 31.12.9999 * 47.317,00 INR*
Here the total amount for all the wage types is incorrect. This is my problem. How to correct the displayed total amount. -
Any method to create a SUM Total for a column whose values based on LAG?
I have a question here, and the challenge is to explain my situation well. I am trying to develop a workbook that shows by project and month, the cost this period and the change in cost from the prior period. I want a SUM total on the Cost This Period and Cost Change From Prior Mth columns. So what I want to do looks something like this -
Project Month Cost This Period Cost Chg from Prior Mth
ABCDE Jan $50,000 NULL (since no preceeding row)
ABCDE Feb $75,000 $25,000
ABCDE Mar $60,000 -15,000
Total $185,000 $10,000
I do the Cost Chg from Prior Mth as a new calculation, and use the Insert Formula from Template process to use the F(x) Difference template to create my calculation. That is working just great. If you look at the underlying code for this new column, you can see the LAG function being utilized in calculating this value. I am lagging one row, as you can see from the example above.
I can create a new total and do a SUM for the Cost This Period column and get the correct answer (the $185,000).
The problem I am running into is that I am not getting anything when I try to sum my Cost Chg from Prior Mth column. The result is just blank (does print the total's text, but no amount).
My thought is that the NULL row in this column was messing up the SUM from working. So I created a new calculation and said CASE WHEN Cost Chg from Prior Mth IS NULL THEN 0.00 ELSE Cost Chg from Prior Mth. So I get a new column with the same numbers except for the first row, where I now have a 0 instead of NULL. I then created a new total (SUM function) on this brand new column. Darn. Same result as for the other column. I do not get an amount.
Has anyone else run into an issue with trying to sum up a column of numbers that are being calculated from a LAG function in Discoverer? Any suggestions on how I could get a SUM to properly calculate for this Cost Chg from Prior Mth column? Or have I run across one of those irritating "cannot handle in Discoverer" issues?
Of course I can export the workbook run results to Excel and create the calculation in there, and that works just fine.
John DickeyHi John
Thanks for the question and the great information. That really helped. I love these kinds of questions. They make me think :-)
Just a thought but have you tried altering the SUM to be a CELL SUM?
The SUM will try to evaluate the LAG over the total which would be invalid whereas, at least in theory, the CELL SUM should literally add the values.
Best wishes
Michael -
Find com_id where sum(invoice_total) not equal to zero within a month
How to find com_id where sum(invoice_total) not equal to zero within a month.
SQL> select com_id from invoice group by com_id
2 where sum(invoice_total) !=0
3 and invoice_date between ADD_MONTHS(sysdate,-1) and sysdate
SQL> desc invoice;
TID NOT NULL NUMBER
COM_ID NOT NULL NUMBER
BRANCH_ID NUMBER
INVOICE_OLD_NUM VARCHAR2(4000)
INVOICE_DATE NOT NULL DATE
INVOICE_PO_NUM VARCHAR2(4000)
INVOICE_TOTAL NOT NULL NUMBER(12,2)
TRANSPORT_ID NUMBER
PAID NOT NULL VARCHAR2(4000)
CHEQUE_CASH NOT NULL VARCHAR2(10)
REMARK VARCHAR2(4000)
Thanks
FrancisCREATE TABLE INVOICES(
TID NUMBER NOT NULL,
COM_ID NUMBER NOT NULL,
BRANCH_ID NUMBER,
INVOICE_OLD_NUM VARCHAR2(4000),
INVOICE_DATE DATE NOT NULL,
INVOICE_PO_NUM VARCHAR2(4000),
INVOICE_TOTAL NUMBER(12,2) NOT NULL,
TRANSPORT_ID NUMBER,
PAID VARCHAR2(4000) NOT NULL,
CHEQUE_CASH VARCHAR2(10) NOT NULL,
REMARK VARCHAR2(4000)
INSERT INTO INVOICES (
TID ,
COM_ID ,
BRANCH_ID ,
INVOICE_OLD_NUM ,
INVOICE_DATE ,
INVOICE_PO_NUM ,
INVOICE_TOTAL ,
TRANSPORT_ID ,
PAID ,
CHEQUE_CASH ,
REMARK
VALUES (
1,
1,
1,
'OLD_1',
SYSDATE -40,
'PO_1',
100,
1,
'Y',
'CASH',
'REMARK_1');
INSERT INTO INVOICES (
TID ,
COM_ID ,
BRANCH_ID ,
INVOICE_OLD_NUM ,
INVOICE_DATE ,
INVOICE_PO_NUM ,
INVOICE_TOTAL ,
TRANSPORT_ID ,
PAID ,
CHEQUE_CASH ,
REMARK
VALUES (
2,
2,
1,
'OLD_1',
SYSDATE -20,
'PO_1',
100,
1,
'Y',
'CASH',
'REMARK_1');
INSERT INTO INVOICES (
TID ,
COM_ID ,
BRANCH_ID ,
INVOICE_OLD_NUM ,
INVOICE_DATE ,
INVOICE_PO_NUM ,
INVOICE_TOTAL ,
TRANSPORT_ID ,
PAID ,
CHEQUE_CASH ,
REMARK
VALUES (
3,
3,
1,
'OLD_1',
SYSDATE -10,
'PO_1',
0,
1,
'Y',
'CASH',
'REMARK_3');
SELECT COM_ID,
SUM(INVOICE_TOTAL)
FROM INVOICES
WHERE INVOICE_DATE BETWEEN ADD_MONTHS(SYSDATE,
-1) AND SYSDATE
GROUP BY COM_ID
HAVING SUM(INVOICE_TOTAL) != 0; -
How can i reorder the columns in the do not display section of the interactive report.
Hi,
My interactive report contains 185 columns, and the user requieres to build his customized reports with some columns, but the he gets lost between this amount of columns, this would be easier if the columns in the do not display section of the interactive report would be sorted automaticaly, Is this possible?
Thanks a lot,Hi Eva,
One solution would be to order the column names alphabetically. You can create a JavaScript dynamic action to handle the sorting.
The shuttle of the IR attribute "Select Columns" have the ID's "apexir_SHUTTLE_LEFT" or the Hidden colums and "apexir_SHUTTLE_RIGHT" for the displayed columns.
The function you'd need to create would look like:
var options = $('select#apexir_SHUTTLE_LEFT option');
var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value }; }).get();
arr.sort(function(o1, o2) { return o1.t > o2.t ? 1 : o1.t < o2.t ? -1 : 0; });
options.each(function(i, o) {
o.value = arr[i].v;
$(o).text(arr[i].t);
var options = $('select#apexir_SHUTTLE_RIGHT option');
var arr = options.map(function(_, o) { return { t: $(o).text(), v: o.value }; }).get();
arr.sort(function(o1, o2) { return o1.t > o2.t ? 1 : o1.t < o2.t ? -1 : 0; });
options.each(function(i, o) {
o.value = arr[i].v;
$(o).text(arr[i].t);
You'd need to find the propper timing for the dynamic action to run, I guess click of the button "Select Columns" would do the trick.
Regards,
Vincent
http://vincentdeelen.blogspot.com -
Apple macbook pro with retina display is having yellow screen problems in which screen is not perfectly white and is yellowish. More over the service frm apple's part is ridiculous as they have faulty spare part. Does ne1 hv email of senior person?
Apple service centre employee told me that they do not have this 14 day offer in India.
And My mac book pro is taken in by Service centre people to run test etc and I will be informed the next day if they accept it as a fault or not ?
I feeling ridiculously bad. -
ADF swing: JTabbedPane does not display column names.
Hi all,
I have created an ADF Panel, which allows the user to run a few simple queries against an Oracle database done using ADF view objects and ADF view links and ADF application module.
From the data control area I drag and drop a view link containing a query into a JTabbedPane. But when I run the ADF panel, JTabbedPane does not display the column headers from the SQL as opposed to JScrollPane which does.
Suppose you do a select * from departments(dep_id, manager, state_cd), you will see all column headers meaning dep_id, manager, state_cd, and under each column the corresponding data which was retuned by the SQL if you use JScrollPane. But if you use you use JTabbedPane then you would only see the data which was retuned by the SQL without seeing the column header names meaning dep_id, manager, state_cd.
What do I need to do to make JTabbedPane display columns headers?
I would appreciate your input.
Thanks.
Bobby A.Hi,
JScrollPane should be used. You can add this into a JTabbedPane if you like. Not all Swing panel show table headers
Frank -
Hi,
I've created an enhancement request to allow displayed column headings from ref_cursor output to be copied.
This is still not possible (4.0 EA3)
The ref cursor data can be copied, but not the headings..
See July 2012 discussion of problem in comments at
http://www.thatjeffsmith.com/archive/2011/12/sql-developer-tip-viewing-refcursor-output/Hi,
I think you're out of luck... except if you're on 11g where you can use DBMS_SQL.TO_CURSOR_NUMBER to convert the REF CURSOR to a DBMS_SQL cursor, and then benefit from the DBMS_SQL package to get column details.
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_sql.htm#CHDJDGDG -
Displaying Hierarchies in columns (i.e. across not drill down)
Hi Guys,
My client needs me to display the Organisational Hierarchy and its attribute (manager of each org unit) in columns. i.e. org unit level1, org unit level1 manager, org unit level2, org unit level2 manager, org unit level3, org unit level3 manager,.........
Typically the hierarchies are displayed in rows that is higher node on top and when drill down the subsequent levels underneath it.
Please guys help me out. my client is behind me for thisHi Raj,
I think we need some clarification what exactly you need.
The standard way of showing hierarchies is to show them in one column with different indents depending on the level of nodes. Another columns are to show key figures.
If you want to show the next level of hierarchy not only in the next row but also in the next column then this is not a standard solution and I'd propose to use VBA coding.
So, the answer depends on your needs.
Best regards,
Eugene -
Query of Query count(column) returns blank not zero
This appears to be a bug in 7,0,1,116466 and 8,0,1,195765
Query of Query count(column) or count(*) returns blank not
zero when there are no matches. Properly returns a number when
there are query matches.
e.g. select count(i_id) from PersonnelQuery where i_id <
100
Where does one report these?scottcook,
This was a known bug in ColdFusion 6.x which has apparently
not been fixed.
Bug in CF6 (See the Comments section of the page linked
below)
http://livedocs.adobe.com/coldfusion/6.1/htmldocs/using_29.htm
Workaround
http://www.bennadel.com/blog/244-ColdFusion-Query-Of-Queries-Odd-COUNT-Behavior.htm
To report this as a bug
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform -
Display Sum Total Of Listview Items
Can anyone help me with displaying Sum Total of Listview Items in a label. I tried this:
Dim dblTotal as Double = 0
Dim dblTemp As Double
For Each lvItem As ListViewItem In lvwTemps.Items
If Double.TryParse(lvItem.SubItems(2).Text, dblTemp) Then
dblTotal += dblTemp
End If
Next
Label2.Text = dblTotal
but it's just giving me 0 in the labelHi
Seems like you might have a second VB Editor open? In any case, save the Project, close down VB and rerun will probably fix it.
Regards Les, Livingston, Scotland
Yes, that worked but it gives me an unreal number ..
You'll need to take the unit into consideration and convert all values to the same unit, for example, MB:
Dim dblTotal As Double = 0
Dim dblTemp As Double
For Each lvItem As ListViewItem In lvwTemps.Items
Dim values() As String = lvItem.SubItems(2).Text.Split(" "c)
If Double.TryParse(values(0), dblTemp) Then
If values(1) = "MB" Then
dblTemp *= 1000000
ElseIf values(1) = "KB" Then
dblTemp *= 1000
End If
dblTotal += (dblTemp / 1000000)
End If
Next
Label2.Text = dblTotal
Reed Kimble - "When you do things right, people won't be sure you've done anything at all" -
Suppress the column without hiding Total or Sum
Hi,
In my worksheet i have created Total for One column, But i want to suppress that column without hiding Total.Please help me ASAP.
Thank You,
Vikra,It is not clear what you mean by "a range of rows" ... how is that range going to be defined?
Create a simple table:
CREATE TABLE t (...
Insert some sample data into it:
INSERT INTO t VALUES (...
Then give us a sample of the output you want.
But sure to read the FAQ and learn how to use tags for your listing so we can read it.
Then we can help you.
Maybe you are looking for
-
so me an brother both have ipod touches and he is connect to my account too and i dont recevie any facetimes from my friends but he does how can this stop? help please?
-
Itunes Crashes - Duplicate Podcast Libaries
I have a problem where itunes created a new unwanted 'podcast library'. Now when I try to update or refresh any podcasts in the original 'podcast library', itunes crashes. I have a mac mini powerpc G4 operating osx 10.5.8. My version of itunes is 10.
-
Cannot export HD video from iPhone 4
Hello. As the topic states, I cannot get the video I recorded on my iPhone 4 on to my MacBook Pro (10.5.8). I use Aperture 3.0.3, and when I connect my iPhone to the MBP, Aperture opens and I can easily download my iPhone 4 pictures into Aperture's L
-
Dataflow in HLS doesn't work in real hardware implementations (13 benchmarks)
Hi all, I use Vivaod HLS to generate a hardware IP core using streaming interface (hls::stream) and implement it using Vivado. (ARM controls DMA to send the streaming data to hardware IP and after the hardware processing the data, use DMA to transfer
-
iMOVIE HD 6 is constantly quiting on me while adding transitions or scrolling credits ti HD video.