How to Count Row Values
Hi,
In a Table 50 Columns are there and 10 Records are there. In those 10 records are not inserted all columns (Some are null values). How to find The Count of Record (Row) Values .
For Example
Table
p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 .........
10 20 30 40 50
20 30
60 80
In the Above table, how to find
the count of values in 1st record is 5
the count of values in 2nd record is 2
the count of values in 3rd record is 2
Thanks & Regards,
Hari
Hi ,
CREATE TABLE Sample
Col1 NUMBER(2),
Col2 NUMBER(2),
Col3 NUMBER(2),
Col4 NUMBER(2),
Col5 NUMBER(2),
Col6 NUMBER(2),
Col7 NUMBER(2),
Col8 NUMBER(2),
Col9 NUMBER(2),
Col10 NUMBER(2)
Table Created.
I inserted Data like below
Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9 Col10
10 20 30 40 50 70 60
10 30 40 50 60 20
10 20 30
10 20 30 40
10 20 30 40 50
10 20 30 40 50 60 70 80 90 100
10 20
10 20 30 40
10 20 30 40 50 60 70
10 20 30 40
In the above data, How To find out
1st row has 7 Values (Which Columns are not null)
2nd Row has 6 Values
3rd Row has 3 Values
4th Row has 4 Values
5th Row has 5 Values
6th Row has 10 Values
7th Row has 2 Values
8th Row has 4 Values
9th Row has 7 Values
10th Row has 4 Values
Similar Messages
-
How to count Unique Values in BEx
Hi Guys,
Can anybody please let me know how to count unique values of a characteristic.
Thanx in advance
PeterI have a similar scenario. If i drill up on the characterstic that had a count of one in each record, the total number of records should be stay equal to the summarised results in the last screen.
Would someone know how to do that .
Arti -
How to use row values in Presentation or Administration for calculation
Hi All,
I am working on OBIEE, I want to calculate / or % on two rows.
e.g. In my report row 3 is value 20 and row 5 is value 200.
In same column row 6 I want to display *(row 5 / row 3 )* 200/ 20 i.e. output should be 10.
Else can I use variable to and assign value to variable.
I tried but giving error :
CASE
WHEN "Report Structure".Seq = 101 and Currency.Code = 'SAR' THEN
"Fact Report"."Actual PTD" ,
VALUEOF("col10") = "Fact Report"."Actual PTD"
ELSE "Fact Report"."Actual PTD"
END
I am trying to store row value to repository variable to solve above problem.
My question is how to assign value to variable.
Please guide me to solve this problem.
Thanks In advance
Regards
DixitWhen you want to compare two row values, you can use the lag and lead analytical function of oracle.
lag and lead are analytical functions that can be used to get the value of a column in a previous/next row.
I have made just an example on my blog for a period to period comparison on OBIEE
http://gerardnico.com/weblog/2009/04/17/obiee-period-to-period-comparison-with-the-analytical-function-laglead/
And if you want an example on Oracle :
http://gerardnico.com/wiki/dw/analytic_function/analytic_function_lag
But I don't understand completely your problem. What about the row 1, 2, 4 ? I don't really see you report.
What I see, is that you have a problem with the currency.
You say :
I am trying to store row value to repository variable to solve above problem.For me, it's not possible...
Success
Nico -
How get pervious row value in grid
hi master
sir
I have grid in my form my user design the balance sheet
Then he want add the last row value in next row
Such as
Row2 amount=1000
Row3 row2+2000
Total row3-row2
How I get last row value
Please give me ideaOther solution is to use a collection in a package unit.
Type TYP_COLL is table of Number INDEX BY BINARY_INTEGER ;
my_coll TYP_COLL ;
Then in the Post-Trigger :
my_coll( :system.current_record ) := value ;so you can navigate easily within the collection in both directions Next/Previous.
Easy to get the previous value:
value := my_coll( :system.current_record - 1 ) ;Francois -
I have a tablix grouped on column a and detailed on column b.
I am trying to count the rows in 3 separate ways.
CountDistinct(Fields!A.Value) =work perfectly on group column
CountDistinct(Fields!B.Value) = work perfectly on the detail column
But now I was
Count(Fields!A.Value) = on the group column but I get all the detailed count 13 instead of just the group count of 4.Hi Giss68,
Based on my understanding, you want to calculate the count of the group fields, right?
In your scenario, if you use Count(Fields!A.Value), the expression returns a count of specified values evaluated in the dataset scope. So it’s expected that you get count of all Fields!A.Value instead of grouped fields. Since you want to calculate the count
of grouped column fields, you should use CountDistinct() function.
As we tested in our environment, we specify the expression with CountDistinct() function, we can get expected result.
Reference:
Count Function (Report Builder and SSRS)
CountDistinct Function (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
How to get rows values in a column only ?
How to get all returned values in rows in a column.
e.g., a query gives output as :
123
234
233
12121
all in different rows. But i want the result like this:
123,234,233,12121.All in a single row and a single column .
How is this possible ?prakash wrote:
hi ,
Use the following example
CREATE or replace FUNCTION fn_return_row
RETURN VARCHAR2
IS
v_row VARCHAR2 (32767);
BEGIN
FOR curr_row IN (SELECT ename
FROM emp11)
LOOP
v_row := v_row ||','|| curr_row.ename;
END LOOP;
RETURN v_row;
EXCEPTION
WHEN OTHERS
THEN
RETURN NULL;
END fn_return_row;
select fn_return_row from dual ;Thanks,
P PrakashThere's no need to use PL/SQL when SQL provides adequate functionality to do it.
The title of the thread is misleading as turning rows into columns is called pivoting, but the description of the issue wanting to join all the rows together into a single column, is actually called string aggregation.
As already demonstrated it can be done several ways.
1. with XML functionality
2. using the SYS_CONNECT_BY_PATH method
and if you have 11gR2, there's...
3. the new LISTAGG analytical function.
There is also an undocumented WMSYS.WM_CONCAT function, though this isn't as flexible as other methods in that you can't control the order of the aggregated data so easily, and using such undocumented functions in production code is dangerous, as the functionality could change in future versions of Oracle, as well as it's use making your code such that Oracle will not provide support if the code with issue is using it. -
How to count row in a channel with VB
Hello every body,
First, I'm quite new in VB script and I hope you will excuse me if the question seems stupid. I have several columns with an undefined number of row (for each file; the number of row will be different). As I want to automate the process, I need to know how many row I have per channel, each time I load data from a file (created by a LV programm)
thanks to those able to help me.
HerveMHello HerveM,
There are several ways get the the number of rows, here are two:
L1 = Data.Root.ChannelGroups(1).Channels("Temp_F").Properties("length").Value
L2 = CL("[1]/Temp_f")
The first one is the object oriented method, the second one used the variable CL (Channel Length) to get the number of rows. They both work, and are up to your preference ...
Hope this helps,
Otmar
Otmar D. Foehner
Business Development Manager
DIAdem and Test Data Management
National Instruments
Austin, TX - USA
"For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary." -
How to pass row values through OpenDocument Hyperlink
Hi all,
I should pass through an OpenDocument hyperlink the value of a particular row of my report. No problems about the OpenDocument syntax and about the other parameters that come from prompt answers, but I don't know how to pass only the value of that particular row. This value doesn't come from a prompt.
So for example if the column of my report was "Account number" and the 1° row of the column that comes from the query was "123456", I should pass only the account number "123456" to the linked document.
Moreover, I have to create the hyperlink on the "Account number" column.
Hoping having been clear...
Thanks in advance,
RiccardoHi Stratos,
Thanks for the reply but I have not understood very well.
I try to explain better my issue, making an example of the problem in Open doc syntax
http://aaaaa.bbbbb.com:8080/OpenDocument/opendoc/openDocument.jsp?iDocID=12345&..............&lsSParam1=()&lsSParam2=()&lsSParam3=()
The problem is in the 3° paramater. This parameter is not a user response variable, it comes from an object projected in the report. The object is a numeric type.
The aim is to pass to the 2° report exactly the content of the cell of the 3° parameter, dinamically (I mean depending on the cell selected by the user).
Thanks.
Regards,
Riccardo -
How can count Duplicate value in column?
Regards:
M K SINGHLike this:
SQL> create table t(a number);
Table created.
SQL> insert into t values (1);
1 row created.
SQL> insert into t values (2);
1 row created.
SQL> insert into t values (2);
1 row created.
SQL> insert into t values (3);
1 row created.
SQL> insert into t values (4);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from t;
A
1
2
2
3
4
SQL> select a, count(*) from t group by a;
A COUNT(*)
1 1
2 2
4 1
3 1
SQL> -
How to count unique values based on specific criteria
Hello,
I need to count the number of unique values in column A but only if the text in column I is a specific word - how do I do this?Let's say the values are in A1:A10 and they are numeric, and the text is in I1:I10.
As an array formula, confirmed with Ctrl+Shift+Enter:
=SUM(IF(I1:I10="word",1/COUNTIFS(A1:A10,A1:A10,I1:I10,"word")))
where "word" is the specific word you're looking for.
Regards, Hans Vogelaar (http://www.eileenslounge.com) -
How to count column values?
hi,
i binded my table to database, and i can show values on data.
if i want to count second column's values, what must i do ?
thnx�Do you want something like this:
Table
-------------------------------- |
TableRowGroup1 |
Date | Sales in $ |
----------------------------------|
Jan 1, 2006 | $1000 |
Jan 2, 2006 | $2000 |
Jan 3, 2006 | $3000 |
----------------------------------|
TableRowGroup2
Month | TotalSales |
Jan 2006 | $6000 |
Then, Create two row groups in table
Bind "Select Date, Sales from SalesTable" to TableRowGroup1
Bind "Select 'Jan 2006, sun(Sales) from SalesTable where Date between 'Jan 1, 2006' and 'Jan 1, 2006'" to RowGroup2.
HTH,
Sakthi
Message was edited by:
sakthivel.gopal -
How to count the values to identify the record instead of previous record
Hi friends i have to identify the record, my table is like this, S means sale, from 56 -> 8 sale, and 48 is new, now i have to update the 8 as ->S in table2 i dont no how to do coding for this, and i have inserted a column as is_identify default as N, if there s a partial sale, then i make it as Y, so if there is a Y for 56, then i have to update the new record 48 in table 2, in this i dont no how to do it... so Have to count X+C=N, then i have to set the flag as Y, then for tht record i have to insert new 48 N record in table2, now its not inserting into table2.... how to write coding for this any1 can help me
table1 Table2
lot_id quantity rec_type lot_id quantity activity_type
1256 10 N 1256 10
1234 56 X 1234 56 --------S
1234 48 N
1234 -8 CHello,
this is the forum for the tool {forum:id=260}. Please ask in {forum:id=75} and mark this question as answered so others can spend their time on answering open questions.
Best Regards
Marcus -
How to pass src value into img tag in ADF
Hi,
My Dev : 11.1.2.3.0
How to pass row values into <img> tag.,I used the below code but it's taking empty.,
I tried both ways like #{row.CdFilePath} and ${row.CdFilePath}
<af:iterator var="row"
value="#{bindings.xxx.collectionModel}"
id="i2">
<img src='/ShowImage?src=#{row.CdFilePath}' border='0' style="width:100px; height:100px; margin:5px;"/>
</af:iterator>
Please tell me any other option is there..
ThanksThis works if you use a normal table so I guess it should work here too.
Are you sure the el #{row.CdFilePath} return something?
Why don't you use the adf image tag <af:image source="/ShowImage?src=#{row.CdFilePath}".../> instead of the html img tag?
Should the src property not be enclosed with " instead of your '?
Timo -
Hi All
If I have 2 tables with records in it, with primary Table A and Foreign key Table B structure.Then how to count the no of occurances of each records of table A in table B and print the values.
ThanxHi,
If I understood you can a query like this:
SGMS@ORACLE10> create table a (cod number);
Table created.
SGMS@ORACLE10> create table b (cod number,id number);
Table created.
SGMS@ORACLE10> alter table a add constraint pk_a primary key (cod);
Table altered.
SGMS@ORACLE10> alter table b add constraint fk_b_a foreign key (cod) references a;
Table altered.
SGMS@ORACLE10> insert into a values (1);
1 row created.
SGMS@ORACLE10> insert into a values (2);
1 row created.
SGMS@ORACLE10> insert into a values (3);
1 row created.
SGMS@ORACLE10> insert into b values (1,1);
1 row created.
SGMS@ORACLE10> insert into b values (1,2);
1 row created.
SGMS@ORACLE10> insert into b values (1,3);
1 row created.
SGMS@ORACLE10> insert into b values (2,1);
1 row created.
SGMS@ORACLE10> insert into b values (3,1);
1 row created.
SGMS@ORACLE10> insert into b values (3,2);
1 row created.
SGMS@ORACLE10> commit;
SGMS@ORACLE10> select b.cod,count(*) from b,a where a.cod = b.cod group by b.cod;
COD COUNT(*)
1 3
2 1
3 2
SGMS@ORACLE10>Cheers -
BEX formula.. How to know the row value in formulas dynamically
Hi all,
I just need to clarify a doubt..
Requirement:
COL1 - COL2
Y1 - X
Y2 - X + 12
Y3 - X + 12 + 12
YN - X + 12 + 12 + u2026 12(n)
Y is dynamic from the source datau2026.. Itu2019s the year (2009,2008u2026 etc..)
X value is from the user (i/p variable value). Some dummy valueu2026
Now, the main logic I want to incorporate is like using a formula for COL2
COL2 Formula looks like thisu2026. X + (12 * N) where N= 0 for the 1st row; 1 for the 2nd row; 2 for the 3rd row like thatu2026..
How to dynamically allocate value for N based on the row count?
Pls. let me know if you find somethingu2026.
Thanks.
Edited by: Arun Bala G on May 21, 2010 10:59 AMhow abt this:
This approach only valid for Workbboks..
create COLUMN3 just type like this
0
12
24
and drag this upto end of Col1 and Col2 so it will poulate multiples of 12 then in Column 4 apply the C1-C2+C3..
hope it helps
Sorry Bhaskar,
Hardcoding the formula is not relevant at all. May be you had not read this query properly. Its no way related to being dynamic right... If it was Excel workbook, anyone would have used a simple formula & moved values like cakewalk.
So unfortunate! BEx has some limitations..
All I need in my query is some counter like 1,2,3.... till the end of the last record. That's all.
Pl. find the sample data
COL1 COL2
2009 1.3
2008 13.3 Which is 1.3+12
2007 25.3 Which is 1.3+12+12
2006 37.3 Which is 1.3+12+12+12
Do let me know if you have any clues?
Thanks!
Edited by: Arun Bala G on May 21, 2010 11:20 AM
Maybe you are looking for
-
Money overflow error when updating a Purchase Order
Dear all, Our customer is using SAP B1 2007A, SP00, PL 30 - MS SQL 2005 SP2. The customer can create a purchase order but when they update it the below error appears: Money Overflow; can not display all digits (ODBC-104) [Message 7001-21]" even if th
-
How to find out who created a custom table
I have searched the forum but didn't find an answer so thought I would put it out here. I have a bunch of custom tables that have been created and not assigned to table groups. Some are SM30 wrappers and some aren't. They are all defaulted to &NC& wh
-
How do I connect 1394 (firewire) to my 610-1050y Win 7 (64)
I have a panasonic pv-dc252D camcorder which requires a firewire for video connection. How do I connect to my 610-1050Y?
-
Using Decode to initialize variables.Help please
I need to initialize a variable to a value of Y or N depending upon the argument passed in the function. If the argument has the value 'Y',the variable in the function is set to Y else it is set to N. For this,I'd like to use the DECODE statment. Can
-
How do executables find their data
I've been using linux for a few months now, but I have yet to figure out something that has been nagging at me the whole time: How do binaries find their associated data? Take a game, for instance. Where the binary is located in /usr/bin but the grap