Top N displaying unexpected results
Hi all,
Cannot see the wood for the trees at the moment and need some help to understand why the following is doing
what its doing.
I have a requirement to produce the top 500 articles ranked by sales qty for different categories.
This list of articles is be used in a prequery. The query I have written works fine for top 10, top 100 etc
but gives incorrect results when I run it for top 500.
After some investigation I can see that there are only 467 articles in one of the categories and when the condition
is defined to show more than this amount then the results returned do not seem to make sense.
For example, a condition created showing top 450 in each category works fine, the count for each category shows top 450
articles. If I change this to Top 500 then I get the following : 1st Category = count of 467 articles which is correct as there are only 467 available in total. 2nd category = count of 521 articles of which the extra 21 are very low sales qty figures and should not be there.
Can anyone throw any light on how this functionality is working?
Thanks in advance.
Hi,
You can try filtering out the Top N products in the Define Criteria page itself.
thanks
Similar Messages
-
Colors in JTable - unexpected result when scrolling
Hi Guys,
Looks like I'm having a problem with a JTable.
I have a list of items and they are distinguished by 2 colors (so the end-user can differentiate between them). Anyway, the table colors work ok but when using a JScrollbar the table receives an unexpected result � few of the first items (which are not identical) share the same color.
anyone?
Example of an output (Gil will be colored Green, Dan Yellow, James Green�and so forth)
Gil
Gil
Gil
Dan
Dan
Dan
James
James
James
James
my code looks like this (I'll appritiate if someone can point out where I can have the html tags to display it correctly)
aTable = new JTable(dataModel)
public Component prepareRenderer(TableCellRenderer r, int row, int col)
Component c = super.prepareRenderer(r, row, col);
Color bg = Color.YELLOW;
String[] valuesRaw = (String[]) model.elementAt(row);
if (changeRround)
name1=valuesRaw[0];
changeRround=false;
name2=valuesRaw[0];
if (!name1.equals(name2))
this.switchColor(bg,c);
changeRround=true;
return c;
public void switchColor(Color bg, Component c)
if (colorSwitcher%2==0)
bg = new Color(221, 250, 207);
c.setBackground(bg);
c.setForeground(Color.BLACK);
else
bg = new Color(253, 252, 193);
c.setBackground(bg);
c.setForeground(Color.BLACK);
colorSwitcher++;
}I'm getting there...
aTable = new JTable(dataModel)
public Component prepareRenderer(TableCellRenderer r, int row, int col)
Component c = super.prepareRenderer(r, row, col);
Color bg = Color.YELLOW;
String[] valuesRaw = (String[]) model.elementAt(row);
if (changeRround)
name1=valuesRaw[0];
changeRround=false;
name2=valuesRaw[0];
if (name1.equals(name2))
else
this.switchColor(bg,c);
changeRround=true;
return c;
public void switchColor(Color bg, Component c)
if (colorSwitcher%2==0)
bg = new Color(221, 250, 207);
c.setBackground(bg);
c.setForeground(Color.BLACK);
else
bg = new Color(253, 252, 193);
c.setBackground(bg);
c.setForeground(Color.BLACK);
colorSwitcher++;
} -
Display the result of a query in descending order.
Hello Experts,
How can I display the result of a query in descending order?
Thanks much in anticipation.
Regards.Hi Kumar,
If you want to display char in descending order, in the query designer set the sorting setting as desceing for that particular characteristics, or if you want to see the KF in descending order, create a condition on that KF and set as TOP N and set N as 999999, that would display your KF in descending order.
- Danny. -
TestStand2.0 generates for each result property ( data, limits, status...) of each array element in a NumericArrayTest an extra line in the test report.
How can I change this to display all result properties of one array element in a single line?
How can I reduce the spaces between the property name and its value in the report?
How can I delete the message: "Measurement[x]" and display only the Measurement Alias (named in the Edit Limits menu)?
This means I like to change my report from:
Measurement[0] (ADC1):
Data: 5000
Status: Passed
Measurement[1] (AD
C2):
To:
ADC1: Data: 5000 Status: Passed
ADC2: ...Hi,
What you can do, is use the Override Callbacks for Modify the Report that is Generated.
Also you can also change the report sequence 'reportgen_txt.seq' to achieve the desired affect. If you go for modifying the report sequence then copy this to the User folder and then make your changes.
In the Resources Library you can find simple examples were the report has been modified by either using the Override Callbacks or by modifying the actual sequence.
One other item in the Report Options you will have to set the 'Select a Report Generator for Producing the Report Body' control to use the Sequence instead of the DLL.
Hope this helps
Ray Farmer
Regards
Ray Farmer -
How to display the results in order by based on search value
Hi All,
how to display the results in the below order.
CREATE TABLE TEST( SONGID NUMBER, TITLE VARCHAR2(200))
INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');
INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
SELECT *FROM TEST WHERE INSTR (TITLE, 'MADONNA') > 0
output:
SONGID TITLE
10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
11 CICCONE, MADONNA (CA)
12 DALLIN, MADONNA LOUISE/STOCK
13 MADONNA
14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
15 MADONNA (CA)
16 MIRWAIS AHMADZAI, MADONNA
17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
18 MADONNA (CA),CICCONE
Expected output :
13 MADONNA
14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
15 MADONNA (CA)
18 MADONNA (CA),CICCONE
...if user searches with 'MADONNA' , I have to display the results like title starts with 'MADONNA' first then rest of the records.
Please let me know is it possible to display the results in that order.
Regards,
RajasekharThis may be a bit more accurate:
SQL> SELECT *
2 FROM TEST
3 WHERE INSTR (TITLE, 'MADONNA') > 0
4 ORDER BY INSTR (TITLE, 'MADONNA')
5 ,TITLE
6 ;
SONGID TITLE
13 MADONNA
14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
15 MADONNA (CA)
18 MADONNA (CA),CICCONE
12 DALLIN, MADONNA LOUISE/STOCK
11 CICCONE, MADONNA (CA)
17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
16 MIRWAIS AHMADZAI, MADONNA
10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA) -
KE5Z - Actual Line Item report freezes before displaying the result
Hi,
We have a situation. We have a Z report in Finance. We have linked KE5Z to this Z report using the Report Painter along with 15 others. When we run the Z report it works fine and displays result. In the displayed result, if we futher drill down for the actual line items for a particular profit center, system freezes. It does not display any result even after a long wait.
We did our analysis and found that the program takes the profit center number range from the least available in the profit center group to highest available in the profit center group and starts checking for every line item in it. This happens when the profit center group has more than 50 profit centers in them. When we run KE5Z tcode individually, it runs fine.
We are not sure how to go about finding a way out of it.
Has anyone faced such issue? Do you know of any OSS note that can help us? or If anyone of you can think of a solution or a way to go about it?
Your help on this is much appriciated.
Regards,
Mukund SHi,
Any pointers to this will be appriciated...
Regards,
Mukund S -
Altavista will not display search results
altavista us will not display search results. altavista canada works fine. On us site results will display in no style page but not in basic page style. The page comes up blank. This may have been caused by delta search. I think I have rid my computer of delta? Reloaded firefox. I use norton 360 and have run registry clean up and virus scans. Also cleaned explorer. In explorer the u.s. altavista works ok that is why I think it something to do with firefox and delta search showed up at the same time unwanted and forced a change on my home page. Have cleared computer of what delta files I could find my have something in the registry but I would not know what to look for or to do with. I am running xp
In a round about way you solved my problem cor-el ! At the end of standard diagnostic there was mention of malware so I ran malwarebytes before running profile manager. malwarebytes found 21 items some in the registry. deleted these items and tried altavista us again and to my surprise it is working ok now.I thought norton 360 would catch such things but I guess it doesn't ! will keep and run a malware program from now on. thank you for your help.
-
Search button not displaying search results
I have created a page where you enter a string and click a search button and it will display the file that contains that string. It works on one page but not any of the other pages I have created. I went to dkubiceck page and copied the code for the search button there.
This is the code I used to run the query to bring up the document information:
select score(1) relevance, filename,transcript_id,
dbms_lob.getlength("trans_document") "trans_document"
from transcript_documents
where contains (trans_document, :P20_SEARCH, 1) > 0
order by 1 desc
I can run the script in sql workshop and it returns information but I can't get the page to display anything so I think it has something to do with the search button. Does it have something to do with the button request. I have the request as go which is what the Oracle Text for APEX tutorial indicates. I am at a loss as to why it is working in one place and not in another. HELP!!!!!!!I used the Using Oracle Application Express to Build
Oracle Text Web Applications An Oracle White Paper documentation to create this button. The instructions to create the button is below.
http://www.oracle.com/technology/products/database/application_express/pdf/apex_text_application_v1.6.pdf
To create a button to submit the search:
1. Under Buttons, click the create icon ().
2. For Region, select Search Terms(s).
3. For Task, select Create a button displayed among this region’s items.
4. For Button Name, enter P1_FIND.
5. For Label, enter Find.
6. For Button Style, select HTML Button.
Run your page using the run page icon () and your development username and password. Your page should look similar to the following figure.
This was the instructions to create the query region:
To create a query region:
1. Navigate back to the Page Definition for the Search page. You can do this by using the edit links at the bottom of the running page, Edit Page 1.
2. Under Regions, click the create icon ().
3. For Region Type, select Report.
4. For Report Implementation, select SQL Report.
5. For Title, enter Results.
Using Oracle Application Express to Build Oracle Text Web Applications Page 9
6. Enter the following SQL query:
select score(1) relevance, doc_title, doc_url
from htmldb_documentation
where CONTAINS (doc_url, :P1_SEARCH, 1) > 0
order by 1 desc
7. For Display Conditions, for Condition Type, select Value of Item in Expression 1 is NOT NULL.
8. For Expression 1, enter P1_SEARCH.
This condition specifies to only display the Results region if a term is entered as a search criterion.
Run the page and enter a search criterion for Term(s). Your results should look similar to the following figure.
Figure 2.0
The only thing I added to the query above is a dbms_doc.getlength statement to be able to open a link to the document.
The first 2 times I created this on a page it worked just fine. But now no matter what conputer or schema or application I create this button in it won't display the results. I can admit that I have no experience creating a button with a different request than what comes up in the wizard. And the documentation that I found on creating buttons was of no help.
I have not made any changes to anything in the wizard so can someone guide me as to how to create a button that will allow me to search a document using Oracle Text as described above -
Duck Duck go Browser doesn't display search results, how to fix it?
The same search using other browsers displays the results. But i want to use Duck Duck Go
Did you already try safe mode or clear the recent history?
*[http://mzl.la/MwuO4X Firefox in safe mode]
*[http://mzl.la/NZyoI8 Clear recent history]
Also try reset Firefox
*[http://mzl.la/MnSTZB Reset Firefox] -
I want a stamp to write to the file metadata and be able to display the result in windows explorer. I have read PDF Stamp Secrets and can write to Custom Metadata but don't know how to display that custom field in explorer. Can I have the stamp write to a standard (non-custom) metadata field? Or, how do it get the custom field to display in explorer? Windows is pretty stingy with the file details it displays for PDF files, in fact there are no editable fields provided (like are available for Office files). I want this to work for multiple users hopefully without having to get the IT group involved to make (or allow) system modifications to make this work. Any ideas? Thank you.
Metadata for Windows Explorer is tagged with different names than the metadata for PDFs. Acrobat cannot copy the metadata to the tagged items of the file header.
There are tools like EXIFTool that can manipulate the data as necessary. Phil Harvey also provides the details about the file types and their metadata tags and values so you should be able to map the tags that need to be updated. -
Displaying file results in combo box
i have read a list of numbers from a file by using vector, and the results are displayed. However i wish to somehow display the results in a jcombo box or equivalent in the main super class, please help, thanks.
BufferedReader in = new BufferedReader(new FileReader("id.doc"));
while (true) {
String File = in.readLine();
if (File == null)
break;
StringTokenizer parser = new StringTokenizer(File, " ");
nxtname = parser.nextToken();
System.out.println(nextt);This reads my id's from file, however I want to display the results into a jcombo box in my main super class, what would the code be to do this?
Thanks -
How to display the result of excutions(insert/update/delete rows)
Hello.
Does anyone know how to display the result of scenario executions just like a scenario executions tab of package (insert/update/delete rows) in other screen (in the intergated operating platform for operators using http)
In additional, I also like to show the hierarchy of scenario in the same view.
So, I need the query using the information of the ODI repository.
If it is possible, I also like to have the decription of the tables in the ODI repository.
Can anyone tell me how can I get the information of the counts of excution?
Thanks in advance.Hi,
You can get that information from the API getPrevStepLog. Does it work for you?
Download the last API reference manual from:
http://www.oracle.com/technology/products/oracle-data-integrator/10.1.3/htdocs/1013_support.html#docs -
2.1 EA2 does not display query results, query works fine in sqlplus
2.1 EA2/Windows XP 32-bit
The following query does not show any results for Total(GB) and Free(GB) columns. The diskgroup name shows correctly.
SELECT
DG.name ,
ROUND(SUM(DSK.TOTAL_MB)/1024,2) "Total (GB)",
round(SUM(DSK.FREE_MB)/1024,2) "Free (GB)"
FROM
V$ASM_DISK DSK,
V$ASM_DISKGROUP DG
WHERE
DSK.GROUP_NUMBER=DG.GROUP_NUMBER
group by DG.name;
The query works fine when run from SQL*Plus:
SQL> SELECT
2 DG.name ,
3 ROUND(SUM(DSK.TOTAL_MB)/1024,2) "Total (GB)",
4 round(SUM(DSK.FREE_MB)/1024,2) "Free (GB)"
5 FROM
6 V$ASM_DISK DSK,
7 V$ASM_DISKGROUP DG
8 WHERE
9 DSK.GROUP_NUMBER=DG.GROUP_NUMBER
10 GROUP BY DG.name;
NAME Total (GB) Free (GB)
DG1 707.98 162.32
DG2 134.84 122.68
SQL>
This must be something unique to SQLDeveloper. I tested in 2.1 EA1 and 1.5.5.59.69 and the query does not show results for the Total (GB) and Free (GB) columns.I would like to update the problem. It seems like when SQLDeveloper is connected to ASM instance, it has trouble using the divide operator (/). For example, the following query works fine:
SELECT
name,
TOTAL_MB
FROM
V$ASM_DISKGROUP;
But if I try to divide the TOTAL_MB by any number, the column shows blank (the column is blank, not NULL). So, if I try to run the following query, the output will just display diskgroup names. The TOTAL_MB/1024 column shows blank.
SELECT
name,
TOTAL_MB/1024
FROM
V$ASM_DISKGROUP;
If I run the same query in SQL*Plus from the same desktop using the same TNS alias, it works just fine which tells me that it is a SQLDeveloper problem.
When I am connected to a regular database, then the problem does not show up and SQLDeveloper is able to display the results even when I am using the divide operator (/). -
This Formula(Function) compiles but does not display any result
Please can anybody help me resolve this issue.The code below is a code for a formula(function) column in oracle report, i have complied this code and it successfully complied but it does not display any result for the column having a stock balance in the entire report.
function CF_STOCK_BALFormula return Number is
v_all_positive NUMBER;
v_all_negative NUMBER;
begin
IF :transaction_type IN ('RECEIPT', 'RETURN') THEN
IF :cp_stock_bal IS NULL OR :cp_stock_bal = 0 THEN
:cp_stock_bal := :opening_balance + :cp_stock_bal + :quantity;
ELSE
:cp_stock_bal := :cp_stock_bal + :quantity;
END IF;
ELSIF :transaction_type IN ('ISSUE') THEN
IF :cp_stock_bal IS NULL OR :cp_stock_bal = 0 THEN
:cp_stock_bal := :opening_balance + :cp_stock_bal - :quantity;
ELSE
:cp_stock_bal := :cp_stock_bal - :quantity;
END IF;
END IF;
RETURN (:cp_stock_bal);
end;
Edited by: Gbenga on Jan 17, 2012 11:30 PMPlease can anybody help me resolve this issue.The code below is a code for a formula(function) column in oracle report, i have complied this code and it successfully complied but it does not display any result for the column having a stock balance in the entire report.
function CF_STOCK_BALFormula return Number is
v_all_positive NUMBER;
v_all_negative NUMBER;
begin
IF :transaction_type IN ('RECEIPT', 'RETURN') THEN
IF :cp_stock_bal IS NULL OR :cp_stock_bal = 0 THEN
:cp_stock_bal := :opening_balance + :cp_stock_bal + :quantity;
ELSE
:cp_stock_bal := :cp_stock_bal + :quantity;
END IF;
ELSIF :transaction_type IN ('ISSUE') THEN
IF :cp_stock_bal IS NULL OR :cp_stock_bal = 0 THEN
:cp_stock_bal := :opening_balance + :cp_stock_bal - :quantity;
ELSE
:cp_stock_bal := :cp_stock_bal - :quantity;
END IF;
END IF;
RETURN (:cp_stock_bal);
end;
Edited by: Gbenga on Jan 17, 2012 11:30 PM -
SQL*plus not displaying the result of XMLELEMENT
HI,
I am using SQL*Plus: Release 10.1.0.4.2
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
When I run the following query in SQL*PLUS, I get nothing displayed. However when I run the same query connecting to the same database using SQL Developer then I get the result
SQL> select XMLELEMENT("form_id",form_id)
2 FROM collections;
XMLELEMENT("FORM_ID",FORM_ID)
In SQL developer
<form_id>101</form_id>
I set long and longchuncksize to 32K , and I change linesize, pages, but nothing helped
Is there any configuration that I have to do, so that SQL*plus display the result of “ select XMLELEMENT("form_id",form_id) query.
Appreciate you help, thanksFrom a fresh start ;) :
SQL*Plus: Release 10.1.0.4.2 - Production on Fri Feb 26 15:29:04 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> select xmlelement("value", a.object_name )
2 from all_objects a
3 where rownum <= 5;
XMLELEMENT("VALUE",A.OBJECT_NAME)
SQL> select xmlelement("value", (select b.object_name
2 from all_objects b
3 where b.object_name = a.object_name
4 )
5 )
6 from all_objects a
7 where rownum <= 5;
XMLELEMENT("VALUE",(SELECTB.OBJECT_NAMEFROMALL_OBJECTSBWHEREB.OBJECT_NAME=A.OBJE
<value>ICOL$</value>
<value>I_USER1</value>
<value>CON$</value>
<value>UNDO$</value>
<value>C_COBJ#</value>
SQL> show all
appinfo is OFF and set to "SQL*Plus"
arraysize 15
autocommit OFF
autoprint OFF
autorecovery OFF
autotrace OFF
blockterminator "." (hex 2e)
btitle OFF and is the first few characters of the next SELECT statement
cmdsep OFF
colsep " "
compatibility version NATIVE
concat "." (hex 2e)
copycommit 0
COPYTYPECHECK is ON
define "&" (hex 26)
describe DEPTH 1 LINENUM OFF INDENT ON
echo OFF
editfile "afiedt.buf"
embedded OFF
escape OFF
FEEDBACK ON for 6 or more rows
flagger OFF
flush ON
heading ON
headsep "|" (hex 7c)
instance "local"
linesize 80
lno 9
loboffset 1
logsource ""
long 80
longchunksize 80
markup HTML OFF HEAD "<style type='text/css'> body {font:10pt Arial,Helvetica,sans-serif; color:blac
newpage 1
null ""
numformat ""
numwidth 10
pagesize 14
PAUSE is OFF
pno 1
recsep WRAP
recsepchar " " (hex 20)
release 1002000300
repfooter OFF and is NULL
repheader OFF and is NULL
serveroutput OFF
shiftinout INVISIBLE
showmode OFF
spool OFF
sqlblanklines OFF
sqlcase MIXED
sqlcode 0
sqlcontinue "> "
sqlnumber ON
sqlpluscompatibility 10.1.0
sqlprefix "#" (hex 23)
sqlprompt "SQL> "
sqlterminator ";" (hex 3b)
suffix "sql"
tab ON
termout ON
timing OFF
trimout ON
trimspool OFF
ttitle OFF and is the first few characters of the next SELECT statement
underline "-" (hex 2d)
USER is "HR"
verify ON
wrap : lines will be wrapped
SQL>
{code}
Maybe you are looking for
-
My original apple id is not an email address . I bought iCloud memory via that same account no problem. When setting up iCloud on iPad you cannot have a primary iCloud account unless it has an email address . Made new account as per instruction ie [e
-
I was backing up my phone with ICloud then all of a sudden it is saying that I have to plug into Itunes. Waht can I do?
-
Crucial M4/USB 3.0 mounting problem
Hi! I've got an issue on my 15" MacBook Pro Retina. I have a 128GB Crucial M4 2.5" SSD in a USB 3.0 enclosure, but the only way I can get it to mount is if I turn the laptop off, plug in the drive and turn the laptop on again. My wife has a mid-2010
-
Unable to install All-in-one Software & Drivers for Officejet 5610 All-in-One printer
I downloaded the software "File name: AIO_CDB_NonNet_Full_Win_WW_130_141.exe [1/1, 362.68M] version 13.1.0" and tried to install but was not successful after number of attempts. I tried HP Printer Install Wizard for Windows also but it also failed. I
-
Content Engine CE565 authentication cache
I have a Content Engine CE565 running software version CE 5.1.7 The commands <show users request-authenticated> and <show http-authcache> provide me with information on authenticated users, but I would like to know how to determine the time remaining