Count the total val of the column in matrix
hi
how to count the total value of the column in matrix
eg:
id name points
10 sachin 100
12 rama 80
count the total points in the matrix
180
Hi Hareesh,
Try This....
Dim finaltot As Integer = 0
Dim i As Integer
For i = 1 To omatrix.RowCount
oedittot = omatrix.Columns.Item("points").Cells.Item(i).Specific
finaltot = finaltot + oedittot.value
Next
Thanks
Shafi
Similar Messages
-
Any way to know whether the column of matrix is active at run-time?
Hi all,
I have posted similar question earlier but it was for setting the column prefrences . In a system form, I am having some user defined columns to which I am copying some data. If they are not active, and if I try to do
Matrix.Columns.Item("U_STNLineno").Editable = True,
It gives me 'form item is not editable' error.
I can fetch the active status from CPRF table, but it updates the status only after SAP B1 is closed.
If atleast, I know, at run time, tht the column is not active, I can prompt user a warning to make it active from form settings.
But, How do I know whether the column is active or not?
any clue?
Thanks in advance..
BinitaMaybe is better solution, but I`m doing it that I`m trying in system objects to do
Matrix.Columns.Item("U_STNLineno").Editable = True
between try catch statement and if is there any error which contains "editable" sentence, I know that it is`nt allowed.
it should be done as
on error resume next
Matrix.Columns.Item("U_STNLineno").Editable = True
if Err.Description <> "" then
-- cannot set
end if
on error goto 0
Petr -
Greetings!
First, thank you for looking at my question. I am trying to count the number of items that = "True" in DataSet2 and display them in the "Week" column in a table who is pointed to DataSet1.
I have a simple table that is set up something like this:
CDC Week |
[Week Number] from DataSet1
| Total
Count of Some Item |
[CountSomeField] from DataSet1
| [ Total of Row]
Count of Another Item |
[CountOfTrueItems] from DataSet2
| [Total of Row]
With the expected results:
CDC Week |
25
| 26 |
27 |
(n/a)
Count of Some Item |
10 |
20 |
30 |
(Expected 60 but not working yet)
Count of Another Item |
5 |
10 |
15 |
(Expected 30 but not working yet)
Instead I get:
CDC Week |
25 |
26 |
27 |
(n/a)
Count of Some Item |
10 |
20 |
30 |
(Not working yet)
Count of Another Item |
30 |
30 |
30 |
(Not working yet)
DataSet1 has a few columns including a "Week" column. DataSet2 has two columns, "WEEK" and "POS".
I need to count items when POS = "TRUE" in DataSet2 and group them on the "Week" column.
My current expression is =SUM(IIF(Fields!Pos_.Value = "True", 1, 0), "DataSet2")
And while this returns a value, it does not count (or sum) by each week. I am missing something...
Thank you for any assistance!
p.s. Sorry My html skills are not shining with the table formatting :(Hi,
Would you please provide some screenshots?
Work hard, play harder! -
To get the count of records and able to access the column value in a single
Hi
Is there any way to get the number of records in the query and access the column values
e.g
select count(*)
from
(SELECT department, COUNT(*) as "Number of employees"
FROM employees
WHERE salary > 25000
GROUP BY department ) a
This wil only get the Count, if i want to access each row from the inline view how can i do that.Your question is not clear.
Are you looking for total record count as well as count by department ?
Something like this?
SQL>
SQL> with temp as
2 (
3 select 1 dept ,10000 sal from dual union
4 select 1 dept ,25100 sal from dual union
5 select 1 dept ,30000 sal from dual union
6 select 1 dept ,40000 sal from dual union
7 select 2 dept ,10000 sal from dual union
8 select 2 dept ,25100 sal from dual union
9 select 2 dept ,30000 sal from dual union
10 select 2 dept ,40000 sal from dual )
11 select count(*) over( partition by 1 ) total_count,dept,
12 count(*) over(partition by dept) dept_cnt from temp
13 where sal>25000;
TOTAL_COUNT DEPT DEPT_CNT
6 1 3
6 1 3
6 1 3
6 2 3
6 2 3
6 2 3
6 rows selected
SQL> -
How to display the total at the end of the column in the report.
Hi all,
Could any one please intimate, how to display the total at the end of the column. For example, i have a column, "sales" as the Key figure, and it has the data for all the transactions. Now, i would like to display the total at the end of the report, below the same column.
Similarly, for all the other columns in the report, i need to display the total for all the columns in the report.
Thanks & Regards,
A.V.N.RaoHi All,
Thanks for many suggestions. I tried by providing the "Total" under "Calculate Results as" and also "Counter for all detailed values" under "Calcuate Single Values as", in the "Calculations" tab of the key figure, but i am unable to get the information. Again, i am providing the requirement below:
CHAR - A CHAR - B TIME CH. - 1 KF -1 KF- 2 KF - 3
1 RAM 2012 1 50 50
2 SAM 2012 2 100 200
Result 3 150 250
Assume KF -1 as "Qty." KF-2 as "Price" KF-3 as "Sales".
Please intimate the solution.
Thanks & Regards,
A.V.N.Rao. -
Count the displayed date rows on a column.
Hi,
I am trying to have a table with the following information and try to give a total count (of the dates visible) at the bottom of the table for the date columns. (not counting the rows)
(E.g.- Under the Sent column there are 5 dates displayed and there are 6 numbers associated. On the received column there are 3 dates displayed for 6 numbers)
Could you please advice me how to accomplish this. Thank you in advance.
Rob.
Name SENum SentReceived
John 1234 12/22/06
5678 12/13/06
6565 12/19/06 1/6/07
5656 - -
Jane 9866 12/18/06 1/5/07
Jim 5657 12/18/06 12/14/06
Total: 5 3I ma not sue what you want but
here is some idea at sql plus
SQL> compute count of ename on deptno
SQL> compute count of sal on deptno
SQL> select deptno,ename,sal from emp order by deptno
2 ;
DEPTNO ENAME SAL
10 CLARK 2450
KING 5000
MILLER 1300
count 3 3
20 SMITH 880
ADAMS 1100
FORD 3000
SCOTT 3000
JONES 2975
count 5 5
30 ALLEN 1600
BLAKE 2850
MARTIN 1250
JAMES 1045
TURNER 1500
WARD 1250
count 6 6
DEV 5000
count 1 1 -
When Requested for a Grand Total the column values changes to zeroes
Hi,
I have a report with 2 dimensions and 4 facts. The report is showing the correct data when compared with EBS, but when we are applying grand total in Table View then for fact values are displaying zeroes. However the grand total is correct but for some dimensions the measures are displaying zeroes.
At this point i have modified the Aggregation rule of 1 measure from Default to SUM and when i clicked results Wonder, i can see grand total and the zeroes were replaced with actual values. When i have compared logical queries before applying the aggregation and after, the measure is surrounded with function REPORT_AGGREGATE and REPORT_SUM respectively.
Can anyone explain me why is this behavior occurred, i got the solution but i am not in stage to explain to client why it happened.
Kindly help and i will make sure it is definitely marked.Re: Bottom Line Grand Total
Use the Subtotal function instead of the Sum function for all totals.
The Subtotal function ignores other Subtotal functions in the column you are summing.
Your three "Sum" functions would look something like...
=SUBTOTAL(9,J3:J7) '300
=SUBTOTAL(9,J8:J14) '900
=SUBTOTAL(9,J3:J14) '1200
'--- Info
1 AVERAGE
2 COUNT
3 COUNTA
4 MAX
5 MIN
6 PRODUCT
7 STDEV
8 STDEVP
9 SUM
10 VAR
11 VARP
Jim Cone
Portland, Oregon USA
free and commercial excel programs at...
https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2 -
How to get the column count at the bottom of the column
Hi Friends,
How to get the column count at the bottom of the column
Thanks
RajYou mean row count? Add another column, click on the fx button and type RCOUNT(1).
If you want just the total you can make it MAX(RCOUNT(1)), hide this column and then add a Narrative View after your report and enter "Total Number of Records: @n" where "n" represents what order your column is from the left side. -
Format the total value in the column of the graph table
Hello all,
I have a graph table and I need to format the total value in the column of the table.
I am trying to find my table bean with the code below but it's not working in the processRequest. Is there anything else that should be done?
// Get the graph
OAGraphTableBean graphBean = (OAGraphTableBean)webBean.findChildRecursive("MyGraph");
// Get the table
OATableBean tblBean = (OATableBean)graphBean.findChildRecursive("MyTable");
The tblBean is null in the processRequest. In the processFormRequest the tblBean is not null.
Thanks and Regards,
AndreaHi,
The code OAGraphTableBean graphBean = (OAGraphTableBean)webBean.findChildRecursive("MyTable"); does not work because in this case I am getting the table but casting to a graph.
The MyTable bean is a child of MyGraph.
When creating a graph bean we have the option to create a table as a child (select your graphTable region in the Structure pane, and choose New > tabularFormat - to create the table).
The table bean child I can get just in the processFormRequest, but the graph I can get in both processRequest and processFormRequest.
I need to get the table bean in the processRequest to format the total value column.
Do you know if is there anything else that should be done to format the total column?
Thanks and Regards,
Andrea -
I'm using Numbers 3.2 and would like to count the names in a column which satisfy a condition in a different column. There are 3 "streams" through which these names have come to me, and I would like to easily identify how many have come from each stream. Any help?
Hi DirtyDawg,
COUNTIF is your friend here.
If your source is in column C and your streams are 1, 2 and 3:
=COUNTIF(C,"=stream1")
=COUNTIF(C,"=stream2")
=COUNTIF(C,"=stream3")
These need to be in a footer or header row or in a different column than C.
hope this helps,
quinn -
Count the no. of rows in a column
I want to count the no. of rows in APR_QTY column that are not equal to zero.
SELECT DISTINCT
SUPP_NAME,
ITEM_NAME,
(CASE WHEN BH_CAL_PERIOD=4 THEN TO_NUMBER(BI_QTY || '.' || BI_QTY_LS) ELSE 0 END)APR_QTY,
(CASE WHEN BH_CAL_PERIOD=4 THEN BI_RATE ELSE 0 END)APR_RATE,
(CASE WHEN BH_CAL_PERIOD=5 THEN TO_NUMBER(BI_QTY || '.' || BI_QTY_LS) ELSE 0 END)MAY_QTY,
(CASE WHEN BH_CAL_PERIOD=5 THEN BI_RATE ELSE 0 END)MAY_RATE,
(CASE WHEN BH_CAL_PERIOD=6 THEN TO_NUMBER(BI_QTY || '.' || BI_QTY_LS) ELSE 0 END)JUNE_QTY,
(CASE WHEN BH_CAL_PERIOD=6 THEN BI_RATE ELSE 0 END)JUNE_RATE,
(CASE WHEN BH_CAL_PERIOD=7 THEN TO_NUMBER(BI_QTY || '.' || BI_QTY_LS) ELSE 0 END)JUL_QTY,
(CASE WHEN BH_CAL_PERIOD=7 THEN BI_RATE ELSE 0 END)JUL_RATE
FROM
OM_SUPPLIER,
OM_ITEM,
OT_BILL_HEAD,
OT_BILL_ITEM,
OT_BILL_ITEM_TED
WHERE BI_BH_SYS_ID = BH_SYS_ID
AND SUPP_CODE = BH_SUPP_CODE
AND ITEM_CODE = BI_ITEM_CODE
AND BH_SYS_ID = ITED_H_SYS_ID
AND BI_SYS_ID = ITED_I_SYS_ID
AND BH_TXN_CODE='SBRLRAW'
GROUP BY BH_CAL_PERIOD,BH_TXN_CODE,SUPP_NAME,ITEM_NAME,BI_RATE,BI_QTY,BI_QTY_LS
ORDER BY ITEM_NAME
Message was edited by:
yogeshylSelect sum(decode(apr_qty,0,0,1)) as cnt_apr_qty
from ... -
Totalling the columns in ALV Grid
Hello All,
I have a output with amount and currencies. The problem i am facing is, the amount is in USD and in GBP and it is giving me single value. It is not splitting the USD amount from the GBP amount.
Also, I am doing a subtotal based on material. This is the most important requirement.
Can anybody help me out in this.
Thanks,
Salil
I am giving the below piece of code if you want to refer it.
DATA: gr_alv TYPE REF TO cl_salv_table,
lr_display TYPE REF TO cl_salv_display_settings,
lr_columns TYPE REF TO cl_salv_columns_table,
lr_column TYPE REF TO cl_salv_column_table,
lr_functions TYPE REF TO cl_salv_functions_list,
lr_sorts TYPE REF TO cl_salv_sorts,
lr_print TYPE REF TO cl_salv_print,
lr_column_f TYPE REF TO cl_salv_columns,
gr_error TYPE REF TO cx_salv_not_found ,
lr_layout TYPE REF TO cl_salv_layout.
DATA: key TYPE salv_s_layout_key,
gr_msg TYPE string.
IF NOT lt_output[] IS INITIAL.
TRY.
* Create ALV instance - use CALL METHOD since this is a static method
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = gr_alv
CHANGING
t_table = lt_output.
lr_display = gr_alv->get_display_settings( ).
lr_display->set_list_header( text-ttl ).
* Get functions object and then set all the functions to be allowed
lr_functions = gr_alv->get_functions( ).
lr_functions->set_all( ).
DATA: lv_field TYPE lvc_fname.
* Get column settings object and then optimize the column widths to the
* data
lr_columns = gr_alv->get_columns( ).
lr_columns->set_optimize( ).
*--- set column header for custom field Difference in Qty
TRY.
lr_column ?= lr_columns->get_column( 'BUCHM2' ).
lr_column->set_output_length('12').
lr_column->set_long_text( 'Diff Qty' ).
lr_column->set_short_text( 'Diff Qty' ).
lr_column->set_medium_text( 'Diff Qty' ).
CATCH cx_salv_not_found INTO gr_error.
gr_msg = gr_error->get_text( ).
MESSAGE gr_msg TYPE 'I'.
ENDTRY.
*--- set column header for custom field Difference in Qty Abs
TRY.
lr_column ?= lr_columns->get_column( 'BUCHM3' ).
lr_column->set_output_length('13').
lr_column->set_long_text( 'Diff Qty(Abs)' ).
lr_column->set_medium_text( 'Diff Qty(Abs)' ).
* lr_column->set_short_text( 'Diff Qty(Abs)' ).
CATCH cx_salv_not_found INTO gr_error.
gr_msg = gr_error->get_text( ).
MESSAGE gr_msg TYPE 'I'.
ENDTRY.
*--- set column header for custom field Difference in Value
TRY.
lr_column ?= lr_columns->get_column( 'VALUE' ).
lr_column->set_output_length('15').
lr_column->set_long_text( 'Value Diff' ).
lr_column->set_medium_text( 'Value Diff' ).
lr_column->set_short_text( 'Value Diff' ).
CATCH cx_salv_not_found INTO gr_error.
gr_msg = gr_error->get_text( ).
MESSAGE gr_msg TYPE 'I'.
ENDTRY.
*--- set column header for custom field Difference in Value Abs
TRY.
lr_column ?= lr_columns->get_column( 'VALUE_ABS' ).
lr_column->set_output_length('15').
lr_column->set_long_text( 'Value Diff(Abs)' ).
lr_column->set_medium_text( 'Value Diff(Abs)' ).
CATCH cx_salv_not_found INTO gr_error.
gr_msg = gr_error->get_text( ).
MESSAGE gr_msg TYPE 'I'.
ENDTRY.
*--- set column header for custom field Status
TRY.
lr_column ?= lr_columns->get_column( 'STATUS' ).
lr_column->set_output_length('15').
lr_column->set_long_text( 'PI Item Status' ).
lr_column->set_medium_text( 'PI Item Status' ).
CATCH cx_salv_not_found INTO gr_error.
gr_msg = gr_error->get_text( ).
MESSAGE gr_msg TYPE 'I'.
ENDTRY.
*--- set column header for custom field Status
TRY.
lr_column ?= lr_columns->get_column( 'TOTAL' ).
lr_column->set_output_length('15').
lr_column->set_long_text( 'Total Value Diff' ).
lr_column->set_medium_text( 'Total Value Diff' ).
CATCH cx_salv_not_found INTO gr_error.
gr_msg = gr_error->get_text( ).
MESSAGE gr_msg TYPE 'I'.
ENDTRY.
* Optimize the column widths for printing.
lr_print = gr_alv->get_print( ).
lr_print->set_print_parameters_enabled( value = 'X' ).
lr_print->set_column_optimization( value = 'X' ).
*--- This code is to get the layout,save the layout and display the
* layout
lr_layout = gr_alv->get_layout( ).
lr_layout->set_default( cl_salv_layout=>true ). " allow default
key-report = sy-repid.
lr_layout->set_key( key ).
lr_layout->set_save_restriction( cl_salv_layout=>restrict_none ).
DATA: init_layout TYPE slis_vari.
init_layout = p_layout.
lr_layout->set_initial_layout( init_layout ).
*--- display report
gr_alv->display( ).
CATCH cx_salv_msg.
WRITE: 'Error displaying grid! - cx_salv_msg'.
CATCH cx_salv_not_found.
WRITE: 'Error displaying grid! - cx_salv_not_found'.
CATCH cx_salv_data_error.
WRITE: 'Error displaying grid! - cx_salv_data_error'.
CATCH cx_salv_existing.
WRITE: 'Error displaying grid! - cx_salv_existing'.
ENDTRY.
ELSE.
MESSAGE s004.
ENDIF.Can you use something like function module CONVERT_CURRENCY_BY_RATE to convert one set of currencies so all amounts are in the same currency before you display them in the ALV?
- April King -
How do I count the unique value pairs in two columns of a table?
I have a table (Table 2) that is populated with data from an imported .csv file. On table 1 I need to count the unique value pairs in two columns of Table 2.
Here's what I have:
Date Person
7/10/2011 A
7/12/2011 W
7/12/2011 X
7/12/2011 X
7/12/2011 X
7/12/2011 Z
7/14/2011 Z
7/15/2011 X
7/16/2011 Z
I'm focusing on person "X" and can easily count how many days that person shows up but what I want is to see on how many unique days that person shows up.
Here's the result I'm looking for (Person "X" shows up on 2 different days - 3 times on 7/12/2011 and once on 7/15/2011):
X 2
I can't seem to find a function that allows me to do that. I also am not allowed to modify Table 2 so that leaves me to come up with a solution on Table 1.
Any ideas would be greatly appreciated.Hi John,
Not being allowed to modify Table 2 is a minor inconvenience. Just copy (using a formula) the necessary two columns onto Table 1.
Yellow columns may be hidden. The procedure progresses from left to right. All formulas are entered into row 2 then filled down that column to the end of the table. The table must be as long as the list in column A of Table 2.
A2: =Table 2::A
Fill right to column B.
Fill both columns down as far as needed.
I've used actual Date and Time values in column A, formatted to show only the Date part, but the technique will work with text in these cells, provided all cells representing the same 'date' have exactly the same content.
C2: =A&B
This concatenates the contents of each row of columns A and B into a single text string.
D2: =COUNTIF($C$2:C2,C)
This counts the number of occurrences of the Date&Name string on the current row from the first regular cell in column C (C2) to the current cell.
E2: =IF(COUNTIF($B$2:B2,B)=1,MAX($E$1:E1)+1,"")
This constructs the index of first occurrences of each name, in the order they first occur. The index is used by LOOKUP in column F.
F2: =IF(ROW()-1>MAX(E),"",LOOKUP(ROW()-1,$E,$B))
This uses the index value created in E as a search-for value to extract a single copy of the names in column B. The result is a list of all distinct names in the list. Note that spelling differences will be counted as distinct names.The IF statement stops the listing when the last distinct name is extracted.
G2: =IF(LEN(F)>0,COUNTIFS($B,"="&F,$D,"=1"),"")
This counts the number of 'first occurrences of distinct Date & Name strings for each name on the list (ie. the number of distinct dates on which each name appears in the original list).
All of the functions used are described, with at least one example for each, in the iWork formulas and Functions User Guide. You can download the guide, and the Numbers '09 User Guide, via the Help menu in numbers.
Regards,
Barry -
Year Total of Gross Margin % Plan in the column for months
Dear Experts,
I have designed a query with the KFs "Sale/Retail, Gross Margin% and Sales/Cost" in the rows and months in the column. I have put "Gross Margin % and Sales/Retail" as input ready and the Sales At Cost is getting calculated with the formula applied over Gross Margin %.
So if i am enetring 1000 for Sales/Retail in Jan month with Gross Margin % as 10%. the value of Sales/Cost is getting calculating correctly as 900.
Now i want to add a total column which will show the year total result of my planning for all months.
Here i am facing the problem.
I have inserted a Formula (named as "Year"), and put the formula to add all the months.
Suppose now i have entered 1000 Sales/Retail and Gross Margin % as 10% in Jan and Feb month.
So now the total figures in the Year column is correct for the Sale/Retail=2000 as it is getting added for every month, but the Gross Margin % is not correct as it is also getting added to 20%. And because of this the Sales/Cost is also wrongly calculated.
The Gross Margin % should be avearge of all months.
Can somebody help me to resolve. Any better idea to insert total column for the months will also help me.
Warm Regards
AbhishekHi Gokul,
I have resolved the thing. Actually. When i use the Tab "Calculations" in the Query Designer. The effect reflects in the result and Overall result section.
But i wanted to correct the Data Input section with the Year total. So i have put the formula in the cells and used collision functionality to avoid the formula collision. So this resolved the problem.
Thanks.
Warm Regards
Abhishek
Edited by: Abhi Goel on Jun 3, 2010 1:29 PM -
Count the items in a column with multiple values?
Hi all
Is there a way to count the items in a column that allows multiple values?
Example list:
Course title: Participants:
Visual Basic Introduction John Smith; Lois Lane; Clark Kent
Visual Basic Advanced John Smith; Lex Luthor
The result should be "3" and "2" (number of participants), which should be displayed in the list or on the page.
Is this possible?
( I am using Sharepoint 2007 and have access to Sharepoint designer.)
Thanks!Hi dee,
We can use XSLT to do this in Data View Web Part.
First, display your list in data view web part.
Insert a new column in the data view, used to display the count.
Switch to code mode, add following code within the <td></td>.
<td>
<xsl:choose>
<xsl:when test="@Title!=''">
<xsl:variable name="count">
<xsl:call-template name="countChar">
<xsl:with-param name="str" select="@Title" />
<xsl:with-param name="count" select="1" />
</xsl:call-template>
</xsl:variable>
count is <xsl:value-of select="$count" />
</xsl:when>
<xsl:otherwise>
count is <xsl:value-of select="0" />
</xsl:otherwise>
</xsl:choose>
</td>
And put the following template definition outside all the other templates.
<xsl:template name="countChar">
<xsl:param name="str" />
<xsl:param name="count" />
<xsl:choose>
<xsl:when test="contains($str, ';')">
<xsl:call-template name="countChar">
<xsl:with-param name="str" select="substring-after($str, ';')" />
<xsl:with-param name="count" select="number($count) + 1" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$count" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Done and then you will see the count in the td cell.
I test with Title column and cut off string with ";" character.
Thanks & Regards,
Emir Liu
TechNet Subscriber Support in forum
If you have any feedback on our support, please contact [email protected]
Emir Liu
TechNet Community Support
Maybe you are looking for
-
Mac apple access via Citrix AG
I am attempting to connect my apple Mac mini (late 2012) running Mavericks 10.9.1 on my home wifi via my Citrix AG connection to remote my desktop in my office. My IT guys tell me that once logged in to the portal page and load the Citrix AG client t
-
PO is fully received but its still displayed in CJI5 with commit = 0
I have a Material PO with 2 line items fully received (Good Receipt). The PO Line Items Total Amounts and Quantities are correctly shown in CJI3 (Actual Cost). However, the PO Line Items are still shown in CJI5 with Outstanding Commitment Amount = 0.
-
I have a static method which takes a few String and double parameters and contains only local variables. When it is called by multiple threads there seems to be an exception thrown intermittenly. I got a little paranoid and so I've changed it to an i
-
How to get report symbol in cube
Hi Experts, In one of my cube not showing report symbol (only for new request) so how to get the report symbol. Regards, Siva
-
How to "include" another page or servlet in a standard servlet
How can I achieve a "include" in a servlet? From what I see... the include() method is on the PageContext class, which is in org.apache.somewhere... right?? Or am I missing something? thanks