How to reset a row count based on a column value?
OracleBI Discoverer 10g (10.1.2.3)
Oracle Business Intelligence Discoverer Plus 10g (10.1.2.55.26)
I've got a Discoverer Plus report that shows item receipts, receipt dates, and if the receipt was inspected. I've got items that should be inspected every 5th receipt. There's got to be a handy-dandy function I can use to do this, right?
Item Receipt Date Inspected
Bracket 1/1/2009 Y
Bracket 2/1/2009 N
Bracket 3/1/2009 N
Bracket 4/1/2009 Y <--let's assume someone didn't follow the instructions
Bracket 5/1/2009 N
Bracket 6/1/2009 N
Bracket 7/1/2009 N
Bracket 8/1/2009 N
Bracket 9/1/2009 I'm looking to count the receipts and reset the counter when Inspected = Y
Item Receipt Date Inspected Inspect_Count
Bracket 1/1/2009 Y 0
Bracket 2/1/2009 N 1
Bracket 3/1/2009 N 2
Bracket 4/1/2009 Y 0
Bracket 5/1/2009 N 1
Bracket 6/1/2009 N 2
Bracket 7/1/2009 N 3
Bracket 8/1/2009 N 4
Bracket 9/1/2009 5 <-- receiver should inspect on this receipt I'm open to other methods if mine seems like a dud.
-Tracy
Hi,
You can use this query for achieve your requierment in your view or you can include in your etl .
REgards salim.
SELECT item, receipt_date, inspected
FROM table_inspect;
ITEM RECEIPT_DA INSPECTED
Bracket 01/01/2009 Y
Bracket 02/01/2009 N
Bracket 03/01/2009 N
Bracket 04/01/2009 Y
Bracket 05/01/2009 N
Bracket 06/01/2009 N
Bracket 07/01/2009 N
Bracket 08/01/2009 N
Bracket 09/01/2009
9 rows selected.Solution
SELECT item,receipt_date,inspected,inspect_count
from table_inspect
model
partition by (item)
dimension by( row_number()over(partition by item order by receipt_date) rn)
measures(receipt_date,inspected,0 Inspect_Count )ignore nav
(Inspect_Count[rn]= case when inspected[cv()]='Y' then 0 else Inspect_Count[cv()-1]+1 end)
order by receipt_date;
ITEM RECEIPT_DA INSPECTED INSPECT_COUNT
Bracket 01/01/2009 Y 0
Bracket 02/01/2009 N 1
Bracket 03/01/2009 N 2
Bracket 04/01/2009 Y 0
Bracket 05/01/2009 N 1
Bracket 06/01/2009 N 2
Bracket 07/01/2009 N 3
Bracket 08/01/2009 N 4
Bracket 09/01/2009 5
9 rows selected.Edited by: Salim Chelabi on 2010-03-03 07:49
Similar Messages
-
How to get the row Count of a ResultSet
How to get the row Count of a ResultSet
Hi
I'v tried rennie1's way ,but I only get zero,my code is:
rs.executeQuery("select count(*) from t_test");
if (rs.next()) int rowCount=rs.getInt(1);
I also tried barni's way ,but the method rs.last() and rs.beforeFirst() throw a same Exception
I tried another way,the code is:
while rs.next(){
// Do nothing ,just move the cursour to the last row
int rowCount=rs.getRow()
However,the rowCount still equal zero
Any help would be greatly apprecite!
note:
I get connection by DataSource's JNDI name from client, the Server is Weblogic Server 6, the DBMS is Oracle. -
How to get visible row count in JTable ?
I have one table which is added to one scroll pane. For example my table have total 1000 rows, but at a time only 20 rows should be visible to the scroll pane. And I want to scroll the rows and show only 20 at a time.When user scrolls JTable then next time he can view only 1 to 21, then 2 to 22, and so on. I want to know how to get that number which represents the visible row( in this case it is 20).So kindly help me how to get visible row count. Any help regarding this will be appriciated.
Thanks and Regards,
Sheetalhow to get visible row count.First you need to get the viewport used by the scrollpane. Then you can use methods like getViewPosition() and getViewSize() to get information about the current postition of and size of the viewport.
Then you can use the table method getRowAtPoint(). to determine the first and last visible row which can then be used to calculate the visible row count.
When user scrolls JTable then next time he can view only 1 to 21, then 2 to 22, and so onThis is the default behaviour when a "block" scroll is done.
However when you click on the arrow button on the scrollbar it will only scroll a single row. You could override the getScrollableUnitIncrement() method to return the value from the getScrollableBlockIncrement() method.
However the user can still drag the scrollbar manually which would cause a problem. So you would also need to remove the MouseMotionListeners from the scrollbar to prevent this. -
How to restrict a table with its set of data based on a column value in it?
Hi,
I have a scenario in which I have to show a set of data of a pivot table by restricting data based on a column value. I am creating BIP report whose source is from BIA ie.RPD. Based on a column value I want to restrict the data being displayed in the table. Since I also want the hidden data in the first table to be displayed in another table in the same report I cannot restrict the data at the query level i.e at RPD or at BIA. For this reason I used
<?xdofx:if saw3_ = 1?>
the pivot table
<?end if?>
But it does not restrict any data.
Also I tried using the if condition inside the table before the row level looping happens. But no good show even then.
How can I forgo this problem?
Regards,
The MMHi,
See : http://download.oracle.com/docs/cd/E12096_01/books/PubUser/T421739T481157.htm#4535373 regarding column and row.
Regards,
Colectionaru -
Need to color a Table row based on a Column value
Dear Alll
I have a requirement to color the rows of a table based on a column value in it. I have tried and surfed many useful materials over the net. but none of them solves my purpose. Please help me, I know that i can used OADataBoundValueViewObject and create a custom css file and apply color to a particular column of a table using a decode in the select statement of that VO.
But all i need is to color a particular row with a particular color. Need your help with this ........
Please do reply
Best Regards
Edited by: Antony Jayaraj on Mar 27, 2012 8:54 PMThese posts might help you.
How to change the row color based on Condition
Can we colour the rows in the column of a table
Regards,
Peddi. -
How to add the Row count(number of rows in table) in the table header?
Hi,
I'm having a table. This table is viewed when i click on a search button.
<b>On the table header it should dynamically display the number of rows in the table, i.e., the row count.</b>
How to do this? could any one explain me with the detailed procedure to achieve this.
Thanks & Regards,
SureshIf you want to show a localized text in the table header, you should use the <b>Message Pool</b> to create a (parameterized) message "tableHeaderText" like "There are table entries".
Next, create a context attribute "tableHeaderText" of type "string" and bind the "text" property of the table header Caption UI element to this attribute.
Whenever the table data has changed (e.g. at the end of the supply function for the table's data source node), update the header text:
int numRows = wdContext.node<TableDataSourceNode>().size();
String text = wdComponentAPI.getTextAccessor().getText
IMessage<ComponentName>.TABLE_HEADER_TEXT,
new Object[] { String.valueOf(numRows) }
wdContext.currentContextElement().setTableHeaderText(text);
Maybe you want to provide a separate message for the case that there are no entries.
Alternatively, you can make the attribute calculated and return the header text in the attribute getter.
Armin -
How to get the row count of a Table DATA?
Hi,
In my Adobe form layout, I have a Table node which is bound to an internal table. Now at runtime, I want to determine the number of rows that the internal table has, i.e the row count of the DATA node of the Table. How will I be able to determine the no. of rows of the internal table at runtime using Javascript? I am not being able to find any suitable answer in this forum. Please suggest. Thanks in advance.Hi,
If you bind the interactive form table to the internal table and specify some properties, the table will vary its row size according to the number of data available in the internal table.
You have to wrap the table in a sub form, check 'allow page break with contents' and property 'flowed'.
the table will automatically increase its row size...
Is this the reason for which you wanted for the row count..?
If so, this will help you..
Regards.
Surya -
Does anybody knows how to reset page counter (next free page number suggested on page creation)?
If your web host doesn't provide you with meaningful stats, sign-up for Google Analytics. Google will give you more valuable stats about your site visitors than a hit counter will. And it's free.
http://www.google.com/analytics/
Simply paste the GA code they give you into your web pages.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb -
How to reset the Terminal Count indicator on the PXI-6608
Dear Community,
Is there any way to reset the terminal count indicator on the PXI-6608? When I Use Get Attribute.vi I get the correct value the first time, but unfortunately (unlike DAQmx) reading the value doesn't reset it...
I'd like to keep track of how many times it has rolled over. And I don't want to use another counter to do that because I'd like to keep them free for other things.
Thanks!
Cas
Solved!
Go to Solution.Traditional daq does not have a means to reset the terminal count indicator, as far as I know. One thing you might be able to do is change the "output mode" to "toggle" and then read the "output state" to determine rollovers by determining when the output state has changed during your application.
I hope this helps!
gus.... -
How to set visible row count dynamically
i need to place input field so that user enters value for visible row count in ALV WEBDYNPRO
Hi Prabhu,
As Suggested use set_visible_row_count. First count your table entries. based on count display records.
count = LINES( lt_n_contract ).
IF count > 5.
lt_table_settings->set_visible_row_count( value = 10 ).
ELSE.
lt_table_settings->set_visible_row_count( value = 3 ).
ENDIF.
Cheers,
Kris. -
Counting rows based on a column value
Tricky Query.No offence if this is a repeat please.
This is a PROD issue in SYBASE.
TableA has id_flag_listing column
TableA
id_flag_listing
N
N
N
N
N
1) If all rows are set to 'N',then my count should be 0.
PrimaryListing
0
2) If there is one row which is 'Y' then this shoud be:
id_flag_listing
N
N
Y
N
N
PrimaryListing
1
How can I count in this manner?
Do i use decode? I am using
Select sum(decode(flg_active),'Y',1,0))
from TABLEA
Will the above work.??
I am using SQL for Sybase.
Please guide?Did you even tried the SQL query I've given?
Your table A
SQL> SELECT flg_listing
2 FROM
3 (
4 SELECT 'N' flg_listing FROM DUAL
5 UNION ALL
6 SELECT 'N' FROM DUAL
7 UNION ALL
8 SELECT 'N' FROM DUAL
9 UNION ALL
10 SELECT 'N' FROM DUAL
11 UNION ALL
12 SELECT 'N' FROM DUAL
13 ) TABLEA;
FLG_LISTING
N
N
N
N
N
Your table A, from which I count where are of 'Y' value. In these queries, I change TableA contents.
SQL> SELECT count(*)
2 FROM
3 (
4 SELECT 'N' flg_listing FROM DUAL
5 UNION ALL
6 SELECT 'N' FROM DUAL
7 UNION ALL
8 SELECT 'N' FROM DUAL
9 UNION ALL
10 SELECT 'N' FROM DUAL
11 UNION ALL
12 SELECT 'N' FROM DUAL
13 ) TABLEA
14 WHERE flg_listing = 'Y';
COUNT(*)
0
SQL> SELECT count(*)
2 FROM
3 (
4 SELECT 'N' flg_listing FROM DUAL
5 UNION ALL
6 SELECT 'N' FROM DUAL
7 UNION ALL
8 SELECT 'Y' FROM DUAL
9 UNION ALL
10 SELECT 'N' FROM DUAL
11 UNION ALL
12 SELECT 'N' FROM DUAL
13 ) TABLEA
14 WHERE flg_listing = 'Y';
COUNT(*)
1
SQL> SELECT count(*)
2 FROM
3 (
4 SELECT 'N' flg_listing FROM DUAL
5 UNION ALL
6 SELECT 'N' FROM DUAL
7 UNION ALL
8 SELECT 'Y' FROM DUAL
9 UNION ALL
10 SELECT 'Y' FROM DUAL
11 UNION ALL
12 SELECT 'Y' FROM DUAL
13 ) TABLEA
14 WHERE flg_listing = 'Y';
COUNT(*)
3Yoann. -
How to Reset Application Badge Count AS3
Hi,
I have successfully sent an apple push notification using a native extension for adobe air by anders-tbl. The notification simply sets the badge count to 1 and has a little message.
What confuses me is how do I reset this badge count once a user reopens my application or opens the application by clicking on the notification? The badge count always stays at 1 even if I delete the application and reinstall it, it’s still there!!??
I know I can reset the badge count by sending a notification with badge = 0, but I can't dynamically do this by sending an empty APN with badge set to 0 as you only get the device token on first application load? Surely you set this via some kind of AS3 function? I can’t seem to find any help searching google at all.
If anyone knows or can nudge me in the right direction on how you are suposed to do this that would be great.
Cheers,You can learn more about the next AIR mobile and desktop features by applying for our private prerelease program. By doing so, you'll get to know the features of the upcoming release in advance!
-
How to manage the same counter based on Order Number and Order Items
Hi All,
we need some help to build an infocube and a query as described in the following scenario.
ODS 1 (Order Numbers aggregated at month level) defined as:
- Order Month
- Customer
- Counter
ODS 2 (Order Items aggregated at month level) defined as:
- Order Month
- Customer
- Product
- Counter
We would like to build an InfoCube that allows us to create a query through which we are able to compare:
- ODS 1 - Counter, that means the number of orders without considering the product
- ODS 2 - Counter, that means the number of orders where a specific product is included
For example:
ODS 1:
Order Month........Customer........Counter
200701...............20001.............10
200701...............20002.............5
ODS 2:
Order Month.............Customer...................Product..........Counter
200701.....................20001.......................A....................1
200701.....................20001.......................B....................10
200701.....................20002.......................A....................4
200701.....................20002.......................C....................5
The desired query should show the following result
Ord Month.Customer..Product.....Counter....Counter
.................................................(ODS2).....(ODS1)
200701......20001.......A..............1..............10
200701......20001.......B..............10.............10
200701......20002.......A..............4..............5
200701......20002.......C..............5..............5
Do you have any idea how to get this result?
Thanks
Kind RegardsHi Valeria,
Have a look,
<a href="http://sapbwneelam.blogspot.com/2007/08/sap-tables.html">How to... Count the occurrences of a characteristic</a>
<a href="http://sapbwneelam.blogspot.com/">More Docs .....</a>
Hope it Helps
Srini -
How to return "Final Row Count" - where I have suppression filters etc
I am building a data interface that outputs "trade records"
Each report/file has a primary header record
each report/file has a secondary header record for EACH TRADE
each report/file has trade details per account under the secondary header record for EACH TRADE
each report/file has a primary footer record, that shows the total row count of the resultant details
the "Records" count in crystal is not what I need, as when the report prints/Exports, certain of those records are suppressed.
I only need what "lands" in my txt file in respect to that final number of total rows of data
Any suggestions are very greatly appreciated. My search thru the forum did not return an answer that I could see.
thank you!
Chris
Edited by: CHRISTOPHER MAINARD on Jul 27, 2010 5:14 PMThank you - I very much appreciate your response - but about the same time you posted - my experimentation and borrowing of like situation formulae seemed to solve it with some tweaking!
first I added this formula to count each "trade record"
Whileprintingrecords;
numbervar linecnt := linecnt +1
then, in the "file footer" added this:
tonumber({@totalRowCount})DistinctCount ({MoxyAllocation.OrderID})1
thank you again for your input, I'm betting I'll find a use for that in the near future.
CBM -
How to exit from SQL*Plus based on the return value of a SQL select stment?
Hi
I have a SQL script executed from SQL*Plus. I would like to know if SQL*Plus
supports any kind of branching or exiting from script execution based on a
returned value of a SQL select statement. I am on 9i.
Regards,
Tamas Szecsyin sqlplus, you have whenever
ex:
whenever sqlerror exit failure
insert into ...
-- if this fails, then you will be out
insert into ...
-- if this fails, then you will be out
whenever sqlerror continue
insert into ...
-- if this fails, this continues
insert into ...and you have PL/SQL
declare x number;
begin
select count(*) into x from emp;
if (x=14) then null; end if;
end;
/note that you can mix those in some case
-- exit if there is no row in emp
whenever sqlerror exit 1
var dummy number
exec select count(*) into :dummy from emp having count(*)!=0
Maybe you are looking for
-
I can't connect my iphone5 to my Macbook Air via Bluetooth?
Can someone please tell me why I can't connect my iphone5 to my Macbook Air via Bluetooth? Is this just the most ridiculous oversight or is there some underlying reason why this doesn't connect and function properly? How amazing would it be if I coul
-
Posting to Accounting: Retroactive Posting after a change in the GL account
Hello all, i would like to ask you about a problem that we face in a live system throught the integration HR-FI. We have already run live posting to accounting until the end of November. But, the client wants us to change the account of a wage type.
-
Hey. I just got my macbook pro 13inch 2011 serviced due to hard disk failure, which has already happen twice within a month. The thing is i cant seem to restore the preferred data from my time machine. When i try doing so, it does restore but not the
-
Partner bank type field missing in payment proposal list
Hi Gurus, The partner bank type field is not being displayed in payment proposal list whereas I can display the same in vendor line item display. Though there is a field named BnkT in the proposal list the partner bank type is not displayed.
-
Ughh.... So its been a few months since I stopped using CS6 Encore because it loves to crash for all kinds of bad reasons. Today I needed to do a new project, and used a simple 1920x1080p MP4 file created by Adobe Media Encoder, and used a basic menu