Blank rows for every combination
I've got a dimension with this hierarchy of levels A | B | C where all of them are a detail of the previous one.
When I look into the dimension table I get:
A1
A2
A1 B1
A1 B2
A1 B1 C1
A1 B1 C2
etc.
If, in Oracle Answers, I pick up attributes from B and C in the same report, then a record is showed for every combination of B and C with blank attributes for C.
Table B
B1
B2
Table C
C1
C2
C3
The output in Oracle Answers is:
B1 C1
B1 Null
B1 C2
B1 Null
B1 C3
B1 Null
and so on ...
Every row of table B is combined with a row of C and another one with all of its atributtes null.
Any hint?
Nihar
To get the first two rows from each group, you could do this:
Use the ROW_NUMBER() analytic function (see http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions137.htm#i86310)
Now, your question isn't clear what you mean by "last" two rows. Last in what order? Whatever it is, you can use the ORDER BY part of the ROW_NUMBER() function to specify the ordering, and reverse it using DESC - for example:
select acn, adate, cost, appl from (
select acn, adate, cost, appl,
row_number() over (partition by acn order by adate desc) as rn
from acntab
where rn <= 2
order by acn, rnHTH
Regards Nigel
Similar Messages
-
Insert Blank row After every Row in alv report
How to insert blank row After every row in Alv report
what do you mean by a 'blank row'? ALV displays tabular data with 'any' number of columns. Now if you actually want a blank row (no columns at all, just a row), then that is just not possible. If I'm not mistaken, this question was posted before, so try to do a search on SCN. See what is says.
-
How to add a row for every 5 records using logic:iterate
Hi,
In my application, using logic:iterate iam displaying 20 records per page.
I want to insert a row for every 5 records.
Please tell how to insert that row.
Thanks in advance.
MohanI think this could work for you
for (int x=1 ; x<=20 ; x++) {
addRowWithRecord
if (x%5==0)
addEmptyRow
} -
Breakable parse lock, two rows for every sid in x$kgllk
Hi,
I've got query like that
select t.* , (select sid from v$session where saddr = t.KGLLKUSE) sid from x$kgllk t where
2 kglnahsh in (select /*+ no_unnest */ kglnahsh
3 from x$kglob
4 where
5 upper(kglnaown) like upper('USER')
6 and upper(kglnaobj) like upper('PACKAGE')
7* )and I'm getting 2 rows for every session having this lock .
So why is that:
I can see difference in output in KGLHDNSP column .
Is that because Oracle is locking package body and spec separately ?
DB is 9.2.0.8 .
Regards
GregGGregG wrote:
Thanks Jonathan, additionaly I've notice that KGLLKSNM is equal to sid taken from v$session so looks like my scalar subquery is redundant .
Is that good assumption that KGLLKSNM = SID or just coincidence ?GregG
That's correct. If fact, if you query v$fixed_view_definitions you'll find that the definiition of gv$open_cursor confirms this:
select
inst_id,kgllkuse, kgllksnm, user_name, kglhdpar, kglnahsh, kgllksqlid, kglnaobj
from
x$kgllk
where
kglhdnsp = 0
and kglhdpar != kgllkhdl
SQL> desc gv$open_cursor
Name Null? Type
INST_ID NUMBER
SADDR RAW(4)
SID NUMBER
USER_NAME VARCHAR2(30)
ADDRESS RAW(4)
HASH_VALUE NUMBER
SQL_ID VARCHAR2(13)
SQL_TEXT VARCHAR2(60)Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
Author: <b><em>Oracle Core</em></b> -
Display last two rows for every group
Hi,
I want to display only last 2 rows for every group.
My table look like
ACN DATE COST APPL
A6ERA 14-JUN 150 B777
A6ERA 14-JUN 180 B787
A6ERA 15-JUN 120 B677
A6ERA 14-JUN 155 B777
A6ERB 13-JUN 166 A777
A6ERB 14-JUN 157 B777
A6ERB 11-JUN 159 B787
A6ERC 14-JUN 099 B777
A6ERC 11-JUN 102 B788
In the above table, I want to display only the last two rows group by ACN
Like the below table
ACN DATE COST APPL
A6ERA 15-JUN 120 B677
A6ERA 14-JUN 155 B777
A6ERB 14-JUN 157 B777
A6ERB 11-JUN 159 B787
A6ERC 14-JUN 099 B777
A6ERC 11-JUN 102 B788
Please replyNihar
To get the first two rows from each group, you could do this:
Use the ROW_NUMBER() analytic function (see http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions137.htm#i86310)
Now, your question isn't clear what you mean by "last" two rows. Last in what order? Whatever it is, you can use the ORDER BY part of the ROW_NUMBER() function to specify the ordering, and reverse it using DESC - for example:
select acn, adate, cost, appl from (
select acn, adate, cost, appl,
row_number() over (partition by acn order by adate desc) as rn
from acntab
where rn <= 2
order by acn, rnHTH
Regards Nigel -
How can print blank rows for XML output report..
Hi all,
I am working in XML output PO fix format report and in that report there is 3 sections. (1) Header section(2)Line section (3) Footer section. My requirement is like this, header and footer section print in all pages and line section break for next page after printing fix 15 lines in a page. And if any page has less then 15 lines then it generate remaining blank row to maintain footer position.
Please suggest me, how can i generate blank rows and break lines for page if there is more then 15 rows in Line section.
Thanks in Advance!Hi,
<?for-each:ROW?>
<?end for-each?><xsl:variable name="cnt" select="count(//row|//ROW)" />
<?for-each:xdoxslt:foreach_number($_XDOCTX,1,15-count(ROW),1)?> <?end if?>
this will create 15 lines irrespective of you have that much rows of data in xml or not
if you want more help , drop me mail @ [email protected] -
Excel export contains a blank row for the Report Header
Hi,
I am getting a blank row as the first row in my SSRS report when exported to excel. I have already taken care of following things,
1. I have hidden all of the Page Header items using Globals
2. The position of Report Body Tablix is 0, that means there is no space between report header and Report Body.
I have developed this Report in SSRS 2012, please let me know if any more details are required. I think even after hiding Header Items, excel creates a placeholder for page header. I can't remove header from my reports as it is needed to be published in
pdf.
Regards
MohitHi Mohit,
According to your description, you are getting a blank row as the first row in your excel report when you export the report to excel, you have hidden all the items in the Page Header by using the Globals, right?
This blank row is for the page header, although you have hidden all the items in it, but it will still display when export report to excel. Because we can’t hidden the page Header directly. Normally, we can hidden all the items in the page Header, So in
the design phase we can also see the blank area above the report body when preview.
We have an alternative way by add the “SimplePageHeaders” setting in “RSReportserver.config” file, after configuration the page Header will not display in the first row of the worksheet but is rendered to the Excel page header. In Reporting Services, the
“SimplePageHeaders” default value is “FALSE” and it indicates that the page header is rendered to the first row of the worksheet. In order to display the page header in the Header/Footer section of Excel, we need to set the “SimplePageHeaders” setting value
to “TRUE”. I did a test on my local machine and here are my steps:
Navigate to RSReportserver.config file: <drive:> Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\RSReportserver.config.
Backup the RSReportserver.config file before modify it, open the RSReportserver.config file with Notepad format.
Set the Excel rendering extension code like this:
<Render>
<Extension Name="EXCELOPENXML" Type="Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.ExcelOpenXmlRenderer,Microsoft.ReportingServices.ExcelRendering">
<Configuration>
<DeviceInfo>
<SimplePageHeaders>TRUE</SimplePageHeaders>
</DeviceInfo>
</Configuration>
</Extension>
</Render>
4. Save the RSReportserver.config file.
Note: Changing the rendering extension parameters only affects rendering operations on the Report Server.
When I access to Report Manager and export the report(includes a page header) to Excel format, the blank row will disappear now.
Similar thread for your reference:
SimplePageHeader property in SSRS 2008 not working
Removing 2 top blank rows when export to excel in ssrs 2008
r2 report
You can find more detail in these articles about the page header and page footer:
Exporting to Microsoft Excel (Report Builder and SSRS)
If you still have any question, please feel free to ask.
Regards
Vicky Liu -
Setting visible lines and blank rows for all users
At Item Level for Shopping Cart, Confirmation and Invoice Creation there are settings for Number of Visible Rows and Number of Blank Lines (In Settings/Advanced Settings).
How can this be changed for all users?Hi
This is a user specific settings to be performed. in SRM 7.0
Please prepare a document and educate the user to do. This is the best solution
Second Solution
In Setting tabs there are two tabs -Basic Setting and Advance Setting
check the webdynpro components and hide this for all users
Regards
G.Ganesh Kumar -
Unpivot task is generating rows for null inputs
So I have a C# application (VS 2012 with .NET4.5) that builds SSIS (SQL2012) packages programatically. the packages can be opened in the designer and they run fine. However, there is one case that is giving me a problem. I have an
OleDb source connected to a table in SQL server. I am using the unpivot task to convert columns in a sparse matrix to an Entity Attribute Value model. So basically, the primary key value of the source table is a pass-through value in the unpivot
task, each column is mapped to the destination column, and the attribute id is hard coded as the pivot key. Like i said this works great EXCEPT i came across one column and a table that was null for all the rows in the table. when I run the package,
it fails with:
OnError,SERVERNAME,DOMAIN\user,{94E83A3B-5386-4712-BEDC-11E35341675F},{94E83A3B-5386-4712-BEDC-11E35341675F},{3187347C-8D44-4D51-8FDB-B5C4159A58B0},9/14/2012 9:48:02 AM,9/14/2012 9:48:02 AM,-1071607780,0x,There was an error with OLE DB Destination.Inputs[OLE
DB Destination Input].Columns[AttributeId] on OLE DB Destination.Inputs[OLE DB Destination Input]. The column status returned was: "The value violated the integrity constraints for the column."
So I set up a data viewer on the data flow and found that the unpivot component was generating rows for every null value. not only that, but the values for the key column and the attribute id (which was hard coded) were also null for all the rows
sent from the unpivot to the ole db destination. I manually created a package with an unpivot for just the column in question and got the same result. then I inserted a value for every row in the table and the same package runs fine.
can someone offer any help or advice on what might be causing this?its just two columns of data that are concerned. ten character numeric strings in the one and null in the other. the pivot key is hard coded in the unpivot component configuration screen. see the output of the data viewer below. How do
I get Microsoft involved with this?
2013399057 NULL
2013399488 NULL
2013399770 NULL
2013402244 NULL
2013402440 NULL
2013404066 NULL
2013404070 NULL
2013404203 NULL
2013404206 NULL
2013404401 NULL
2013404589 NULL
2013404705 NULL
2013404738 NULL
2013404768 NULL
2013404784 NULL
2013404813 NULL -
Education and Training Report produce a blank row
Hi Experts,
I run Education and Training Report to get a list of employees education. It shows a list of education report but there's a blank row for some employees and others are not. For employees who didn't have education data, it gives a blank row for that employee. I've checked the table and there's not a blank record for each employee. Anyone knows about this probelem?
Thank you for your responds.
Regards,
ErliHi,
I am talking about SAP Personnel Administration Report - Education and Training (T-code S_PH9_46000224).
Thank you for your respond. -
Printing blank page with every printed page
I have a C7280 printer, and it has been working fine. However, it now sends out one blank page for every printed page. any ideas on why this is happening and how to fix it?
thanks.HI,
You might try using this print diagnostic utility to see if it helps solve your problem.
http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=mp-82717-1&lc=en&dlc=en&cc=us&...=
There are several solutions within the utility that fixes several printer issues.
Say Thanks by clicking the Kudos Star in the post that helped you. Please mark the post that solves your problem as Accepted Solution.
I am employed by HP -
Results not updating for every row in BIpublisher
Hi all I have a Bi publisher report that is updating the results for the first row and in the second row to update the results it is picking the values from the first column itself and using the same values for all the other rows.
Here is my report format
Month saves Total, for 30,60,90,120
Jan
feb
Mar
Total are the enrolls by each month and days shows after 30,60,90,120 how many are still active. Following eg should give an idea of exactly whats happening
Eg:
Total 30days 60days 90days 120days 150days 180days 210days
------------------------------------------------------------------------------------------------------------------------------------------------------------ Jan saves 330 287 274 270 263 262 259 257
Feb saves 298 255 242 238 231 230 227 225
Mar saves 291 248 235 231 224 223 220 218
So what is happening is lets say for example there are a total of 330 enrolls in january and after 30days 287 are still active and after 60days 274 are still active after 90 270...... etc
Am getting the January active values correctly.
BUt going forward when I see the values for february The total enrolls for february is 298 and after 30 days which are active is not giving me the correct.
It is substracting the same amount as jan. looking at the numbers it is substracting
-43, -13,-4,-7,-1,-3,-2 for Jan which are the cancels after the consecutive days
It is substracting the same amount for feb also but my actual cancels for feb are different it should be 45,12,8,9,2,2,
It is doing the same for all the months.
There should be a change in the code. Following is the XSL code am using in
<?xdoxslt:set_variable($_XDOCTX, 'v_SavesCanceled', SAVES_CANCELED_COUNT)?>
<?xdoxslt:set_variable($_XDOCTX, 'v_RtSaves', xdoxslt:get_variable($_XDOCTX, 'v_RtSaves') - xdoxslt:get_variable($_XDOCTX, 'v_SavesCanceled'))?>
<?xdoxslt:get_variable($_XDOCTX, 'v_RtSaves')?>
Actually the cancels should be updated for each row but its picking the same cancels for every month.
Hope it is clear let me know if you need any further info
Any help is appreciated.
ThanksThank you very much for your help. The rtf file sent worked and updating results as required.Thank you
Thanks -
How create dynamic URL for every row shown in the report?
Hi,
Iam new to this Application. I created one interactive report to find the number of bugs logged for every product and its sub component for past one year. The report will look like below structure in the application.
Product Subcomponent Total
P1 S1 10
P2 S2 4
P2 S21 15
Now i want to pick the value of Prouct and sub component for every row dynamiaclly and want to generate the URL with the conditions and make it as hyperlink for the Total Column.
Iam able to make hyperlink for the Total column using the edit options for the total attribute, but it is opening the same page for all the rows in the total column. I want to generate dynamic URL by picking the value prodcut and sub componenet dynamically from the report for every row and want to make it as hayperlink for every row individually.
Please tell me how to do this?
Please revert back if you are not clear. Appericiate for your quick help.Hello <unknown user>,
So you already set the Column Link attributes for your Total column. Should all links go to the same page, but with different parameters (ProductID, SubcompID)? Or to another page? And how can you determine that page?
Assuming you'll go to a sort of detail page or form:
Target = [Page in this app]
Page = <your target page no>
Item1 = <ProductID field in target page>
Value = #PRODUCTID#
Item2 = <SubcompID field in target page>
Value = #SUNCOMPID#
(you can use the ' flashlight' for getting the correct values)
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-) -
Excel o/p in Reports 9i-additional report header for every row
Dear All,
Is there any way to generate an Excel file output from OracleReports9i.Actually I have tried the simple report.
I am able to create a delimited output.But the prob is it contains an additional report header for every row of the report and this is very strange.Its coming like that
Empno Ename Job 7566 JONES MANAGER
Empno Ename Job 7902 FORD ANALYST
I need the Xls o/p like that
Empno Ename Job
7566 JONES MANAGER
7902 FORD ANALYST
8877 JAMES SALES
my Environment oracle9i developersuite /forms9i/reports9i
I have given DESFORMAT = DELIMITED
MODE = CHARACTER
I am able to generate the reports in html/HTMLCSSIE/HTMLCSS/PDF/RTF
Only delimited is giving problem
What should i do to resolve this issue. Please help me it is very very urgent for me.
Thanks in advance
Pavendhan.NI had the same problem and this is what I did, works great. You have the total control.
function BeforeReport return boolean is
fp text_io.file_type;
begin
-- creating a file name
:CP_filename := 'C:\Gap'||to_char(sysdate,'MMDDYYHHMISS')||'.csv';
-- Opening the file in write mode
fp := text_io.fopen(:CP_filename,'w');
-- writing the column headings into the file
text_io.put_line(fp,'"Platform","Sys#","GapType",');
text_io.fclose(fp);
return (TRUE);
end;
and then where ever it is suitable, depending on the requirement, write into file by opening it in the append mode.
function R_G_systemplatformFormatTrigge return boolean is
fp text_io.file_type;
begin
-- srw.message(99,:dname);
fp := text_io.fopen(:CP_filename,'a');
text_io.put(fp,'"' || :systemplatform || '",');
text_io.put(fp,'"' || to_char(:sysno) || '",');
text_io.put_line(fp,'"' || :CF_gaptype || '",');
text_io.fclose(fp);
return (TRUE);
end;
This works great. Hope this helps. -
Update Button for every Row of Report
hello,
is it possible to get an update button for every row of a report?
After clicking this button, only this row of the report should be updated.
thanks in advance
daveCreate a hidden item on your page. Call it somehow - P1_KEY. Create other hidden fields
for the rest of the columns you want to update. Create a link per report line. This link will be
inserting the primary key of your record into P1_KEY and the other values you want to
update in the other hidden fields. It will branch to the same page and contain a request - i.e. UPDATE_ROW. Then
you create a process - On Load Before Header - which will
take the value from your item P1_KEY and update the record
in the database by setting the the column values to the
values in your hidden fields. This process will fire upon
request you specified. However, this way you will not be
able to update your text areas, since you will not be able
to transfer this over a link. Also you need to be carefull
about special characters.
Maybe there is a better proposal than this.
Denes Kubicek
Maybe you are looking for
-
Iphoto and organizing albums...
I'm slowly learning iphoto and I'm having a hard time with organizing albums/folders. I like to organize my pictures by using albums/folders like in windows. I've created albums/folders and I'm taking the photos from events and putting them into th
-
I installed ios6 on my ipad2 yday, now its rebooting continously
I installed ios6 on my ipad2 yesterday and today it has gone into a continous reboot cycle. Only the apple sign shows, screen goes blank and then apple sign re-appears. I tried restoring from itunes but it says cannot. need help please
-
Hi, I cannot get my firefox shortcuts to go directly to the profile manager anymore. I don't know why. I know I have set the target up correctly in properties but it still will not go to the profile manger. Please help. Here is what is in the target
-
Volume rebuild using TechTool Pro 5 - How long??
We put the OS X 10.5 install dvd in our Macbook with the intent to edit the administrator password and instead triggered what our Macbook thought was some kind of upgrade. We were afraid to cancel it, but about a minute in the "upgrade" ended up fail
-
Does wowslider work with dreamweaver
DDoes wowslider work in dreamweaver?