Calculating the total of one column within a GridView
Hello Everyone!
I have created a Grid with 6 columns. The 6th column contains monetary values. I have set 'ShowFooter' to 'True' and have styled my footer however there is currently no data in the footer. What
I'm looking to do is calculate the total of the 6th column and put the value within the footer at the bottom of the 6th column - I'm not sure how to go about this so any assistance would be much appreciated.
Thank you
Good morning Griffs,
Check this out...http://stackoverflow.com/questions/19808855/calculate-the-sum-of-gridview-column-data-and-store-its-value-in-a-variable
Danny Rosales .NET Developer
Similar Messages
-
How do i find the total number of fields within all tables in one of my databases
I'm in the process of creating some "gee whiz" metrics for one of my applications and want to find the total number of columns contained in its database. Is there a stored procedure to get this information that would save me the effort
of opening each of my 66 tables and counting the columns? I also have the same question for my 138 views. Thank you for any ideas you care to offer...............Phil Hoop
Phil HoopHi Phil,
Assumes SQL 2005 or higher
Let 's try simple one ....
SELECT COUNT(col.column_name), col.table_name
FROM information_schema.columns col
JOIN information_schema.tables tbl
ON tbl.table_name = col.table_name
AND tbl.table_schema = col.table_schema
AND tbl.table_catalog = col.table_catalog
AND tbl.table_type = 'VIEW'
GROUP BY col.table_name
Let me know if this will help you.
If you think my suggestion is useful, please rate it as helpful.
If it has helped you to resolve the problem, please Mark it as Answer.
Varinder Sandhu www.varindersandhu.in -
Is it possible to create an invoive that keeps a running total in one column and in another column keep total of monies spent from a starting amount of funding?
Hi Sara,
Many thanks for your reply. We just brought Adobe Acrobat XI Pro complete
with Adobe Forms Central, My manager asked whether I could use the forms
part to create a summary tracking sheet for all of our contracts.
Having looked at it I could see how to create a table that in the first
column deleted costs from a starting fund, and in the last keeps a running
total of all monies spent.
I agree, Excel does seem to be much better suited to the task. I was try
trying to comply with her request
Regards, -
How to get all the values in one column of a JTable
How to get all the values in one column of a JTable as a Collection of String.
I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.
-
Is it possible to import the total from one worksheet into another separate worksheet?
In Numbers terminology a File (of document) contains sheets. Sheets contain tables, and graphic elements (circles, text, lines, charts, etc.).
So...
if you are asking if you can reference a cell of a table in another table in the same sheet: yes
if you are asking if you can reference a cell of a table in another sheet: yes
if you are asking if you can reference a cell of a table in another sheet of another document: no -
How to boldface the header for ONE column
hi,
I want to know how to boldface the header for ONE column. The following will boldface the header for all the columns in the table
table.getTableHeader().setFont(new java.awt.Font("Dialog", 1, 12));
Thanks.
Jrabijtable.getColumnModel().getColumn( indexOfBoldColumn ).setHeaderRenderer( TableCellRenderer aRenderer )
-
Design Table with no of columns used for calculating the total
Hello,
I need to design a table/s for calculating the column values based on the operators provided. Like I have a table say
TableID, Col1 , Col2 ,Col3 ... Total Value
Total Value Column is calculating Col1 (operator value provided by the user) Col 2 (operator value provided by the user) Col3 etc
Although I m thinking to create another table which stores operator values, however not sure how to calculate the total.
like it can be COl 1 +Col2 -Col3 %Col4 etc.
Please help.Can you show some data example+ desired result?
DECLARE @t TABLE(a INT,b INT,c INT);
INSERT @t VALUES(1,2,3),(9,8,7),(4,6,5);
SELECT *
, ( SELECT COUNT(val)
FROM (VALUES (a)
, (b)
, (c)
) AS value(val)
) AS CountVal
FROM @t;
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
What formula to add up the values in one column only if a box is checked in the next column?
Hi guys,
I am creating a spreadsheet for my wedding guestlist.
In one column I have a number to tell me the total number of adult guests the party (e.g fried and girlfriend = 2) and then the next two colums are check boxes, one for daytime and the next for nighttime.
What I would like to do is in a footer row under the daytime time checkbox column is to total the first colum (the total number of wedding guests in each party).
I hope that I am explaining this ok, sorry if it is vague.
I understand to use COUNTIF to total the number of checked boxes in the column and have been working on COUNTIF + the sum of the previous column but it's not really working.
Any help will be greatly appreciated.
Thanks,
PhilPhil,
Here's an example of what you might do:
The expression in the footer of column B is:
=SUMIF(B, TRUE, $A)
and, the expression in the footer of column C is:
=SUMIF(C, TRUE, $A)
Regards,
Jerry -
Is it possible to get the total value for column and assign to other field
hi,
Is it possible to get the total value of particular column and assign that value to another field?
How to do this?
Thanks in advance,
SANAfridi,
My extended controller class code:
package xxhr.oracle.apps.per.selfservice.appraisals.webui;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
import oracle.apps.per.selfservice.appraisals.webui.OverviewPageCO;
import oracle.jbo.Row;
public class XXOverviewPageCO extends OverviewPageCO {
public XXOverviewPageCO() {
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("XXCalcAvgButton")!=null){
throw new OAException("welcome",OAException.INFORMATION);
//getSum(pageContext, webBean);
private String getSum(OAPageContext pageContext, OAWebBean webBean) {
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject ratvo = (OAViewObject)am.findViewObject("CompetenceElementsVO");
OAViewObject valuevo = (OAViewObject)am.findViewObject("PerRatingLevelsVO");
Integer Sum = new Integer("0");
int numofRows = ratvo.getRowCount();
for (int x = 0; x < numofRows; x++) {
Object Rating =
ratvo.getRowAtRangeIndex(x).getAttribute("ProficiencyLevelId");
if(Rating!=null) {
int numofRowsforvalue = valuevo.getRowCount();
for(int i=0;i<numofRowsforvalue;i++){
if(valuevo.getRowAtRangeIndex(i).getAttribute("RatingLevelId").equals(Rating)){
Object StepValue=valuevo.getRowAtRangeIndex(i).getAttribute("StepValue");
Sum = new Integer(StepValue.toString()) + Sum;
OAMessageStyledTextBean displayCompAvg=(OAMessageStyledTextBean)webBean.findChildRecursive("XXCompAvgText");
displayCompAvg.setValue(pageContext,Sum);
return null;
But it is not affecting in the page.
Can you please tell me what is the problem. -
Calculating the total in alv and displaying the date
Hi,
I am trying to calculate the totals of netwr and fkimg in a report but the following coding cannot giv me the right answer so if there is anyone with the solution for this problem may you please help me out and how can i display the date on my report......here is my coding:
REPORT Z_DAILY_STOCK_NEW.
TYPE-POOLS: SLIS.
TABLES
TABLES: vbrk, kna1,vbrp,vbap,vbak, sflight.
ALV FIELDS
DATA: it_fieldcat TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: w_cnt LIKE sy-tabix.
total ref to data.
t_alv LIKE TABLE OF s_error WITH HEADER LINE.
DATA: gr_layout TYPE slis_layout_alv,
gr_tab_group TYPE slis_t_sp_group_alv,
gr_repid LIKE sy-repid,
gr_events TYPE slis_t_event,
gr_print TYPE slis_print_alv,
gr_user TYPE slis_formname VALUE 'USER_COMMAND'.
SELECTION SCREEN
SELECT-OPTIONS:
s_werks FOR vbrp-werks,
s_auart FOR vbak-auart.
DEFINITION OF AN INTERNAL TABLE
DATA: begin of i_stocktab occurs 0,
kunag LIKE vbrk-kunag,
name1 LIKE kna1-name1,
ort01 LIKE kna1-ort01,
inco1 LIKE vbrk-inco1,
vkgrp LIKE vbrp-vkgrp,
fkimg LIKE vbrp-fkimg,
netwr LIKE vbrk-netwr,
end of i_stocktab.
START OF SELECTION
SELECT vbrkkunag kna1name1 kna1ort01 vbrkinco1 vbrp~vkgrp
vbrpfkimg vbrknetwr
FROM kna1 inner join vbrk on kna1kunnr EQ vbrkkunrg
inner join vbak on kna1kunnr EQ vbakkunnr
inner join vbrp on vbrkvbeln EQ vbrpvbeln
INTO i_stocktab
WHERE vbrp~werks IN s_werks
AND vbak~auart IN s_auart.
APPEND i_stocktab.
ENDSELECT.
*DATA tb_alv TYPE i_stocktab WITH HEADER LINE.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM build_event.
PERFORM build_print.
PERFORM calc_total.
PERFORM display_alv_report.
FORM build_fieldcatalog.
w_cnt = 1.
it_fieldcat-fieldname = 'KUNAG'.
it_fieldcat-seltext_m = 'Soldtp'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
it_fieldcat-key = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'NAME1'.
it_fieldcat-seltext_m = 'Name'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'ORT01'.
it_fieldcat-seltext_m = 'City'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'INC01'.
it_fieldcat-seltext_m = 'Incoterms'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'VKGRP'.
it_fieldcat-seltext_m = 'Sales Group'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'FKIMG'.
it_fieldcat-seltext_m = 'Invoiced Qty'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
*it_fieldcat-do_sum = 'x'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'NETWR'.
it_fieldcat-seltext_m = 'Invoiced Value'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
it_fieldcat-do_sum = 'x'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
ENDFORM.
FORM build_layout.
gr_layout-no_input = 'X'.
gr_layout-colwidth_optimize = 'X'.
gr_layout-totals_text = 'Totals: '(201).
gr_layout-detail_popup = 'X'.
ENDFORM.
FORM build_event.
DATA i_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = gr_events[].
READ TABLE gr_events WITH KEY name = slis_ev_user_command
INTO i_event.
if sy-subrc = 0.
MOVE gr_user TO i_event-form.
APPEND i_event TO gr_events.
endif.
ENDFORM.
*FORM calc_total.
LOOP AT it_fieldcat into wa_fieldcat
WHERE fieldname EQ 'FKIMG' OR
fieldname EQ 'NETWR'.
wa_fieldcat-do_sum = 'X'.
wa_fieldcat-datatype = 'QUAT'.
modify it_fieldcat from wa_fieldcat.
ENDLOOP.
*ENDFORM.
FORM build_print.
gr_print-reserve_lines = '2'.
gr_print-no_coverpage = 'X'.
ENDFORM.
FORM calc_total.
DATA: total type ref to data,
subtotal1 type ref to data.
field-symbols <fkimg> like sflight.
field-symbols <netwr> like sflight.
call method grid1-> get_subtotals
importing
ep_collect00 = subtotal
ep_collect01 = total.
assign total to <fkimg>.
assign total to <netwr>.
ENDFORM.
*& FUNCTION ALV DISPLAY
FORM display_alv_report.
gr_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = gr_repid
I_CALLBACK_USER_COMMAND = slis_ev_user_command
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE' " see FORM
IS_LAYOUT = gr_layout
IT_FIELDCAT = it_fieldcat[]
IT_SPECIAL_GROUPS = gr_tab_group
I_SAVE = 'X'
IT_EVENTS = gr_events
IS_PRINT = gr_print
TABLES
t_outtab = i_stocktab
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM.
FORM top-of-page.
*ALV Header deaclarations
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
t_line LIKE wa_header-info,
ld_lines TYPE i,
ld_linesc TYPE c.
*Title
wa_header-typ = 'H'.
wa_header-info = 'Report for daily Stock Returns'.
APPEND wa_header TO t_header.
CLEAR wa_header.
*Total No. Records Selected
DESCRIBE TABLE i_stocktab LINES ld_lines.
ld_linesc = ld_lines.
CONCATENATE 'Total No. of Records Selected:' ld_linesc
INTO t_line SEPARATED BY space.
wa_header-typ = 'A'.
wa_header-info = t_line.
APPEND wa_header TO t_header.
CLEAR: wa_header, t_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
ENDFORM.Try This
REPORT z_daily_stock_new.
TYPE-POOLS: slis.
* TABLES
TABLES: vbrk, kna1,vbrp,vbap,vbak, sflight.
* ALV FIELDS
DATA: it_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: w_cnt LIKE sy-tabix.
* total ref to data.
* t_alv LIKE TABLE OF s_error WITH HEADER LINE.
DATA: gr_layout TYPE slis_layout_alv,
gr_tab_group TYPE slis_t_sp_group_alv,
gr_repid LIKE sy-repid,
gr_events TYPE slis_t_event,
gr_print TYPE slis_print_alv,
gr_user TYPE slis_formname VALUE 'USER_COMMAND'.
* SELECTION SCREEN
SELECT-OPTIONS:
s_werks FOR vbrp-werks,
s_auart FOR vbak-auart.
* DEFINITION OF AN INTERNAL TABLE
DATA: BEGIN OF i_stocktab OCCURS 0,
kunag LIKE vbrk-kunag,
name1 LIKE kna1-name1,
ort01 LIKE kna1-ort01,
inco1 LIKE vbrk-inco1,
vkgrp LIKE vbrp-vkgrp,
fkimg LIKE vbrp-fkimg,
netwr LIKE vbrk-netwr,
END OF i_stocktab.
* START OF SELECTION
SELECT vbrk~kunag kna1~name1 kna1~ort01 vbrk~inco1 vbrp~vkgrp
vbrp~fkimg vbrk~netwr
FROM kna1 INNER JOIN vbrk ON kna1~kunnr EQ vbrk~kunrg
INNER JOIN vbak ON kna1~kunnr EQ vbak~kunnr
INNER JOIN vbrp ON vbrk~vbeln EQ vbrp~vbeln
INTO i_stocktab
WHERE vbrp~werks IN s_werks
AND vbak~auart IN s_auart.
APPEND i_stocktab.
ENDSELECT.
*DATA tb_alv TYPE i_stocktab WITH HEADER LINE.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM build_event.
PERFORM build_print.
PERFORM calc_total.
PERFORM display_alv_report.
* FORM build_fieldcatalog *
FORM build_fieldcatalog.
w_cnt = 1.
it_fieldcat-fieldname = 'KUNAG'.
it_fieldcat-seltext_m = 'Soldtp'.
it_fieldcat-emphasize = 'X'.
it_fieldcat-key = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'NAME1'.
it_fieldcat-seltext_m = 'Name'.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'ORT01'.
it_fieldcat-seltext_m = 'City'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
* w_cnt = w_cnt + 1.
* it_fieldcat-fieldname = 'INC01'.
* it_fieldcat-seltext_m = 'Incoterms'.
* it_fieldcat-emphasize = 'X'.
* APPEND it_fieldcat TO it_fieldcat.
* CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'VKGRP'.
it_fieldcat-seltext_m = 'Sales Group'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'FKIMG'.
it_fieldcat-seltext_m = 'Invoiced Qty'.
it_fieldcat-emphasize = 'X'.
it_fieldcat-ref_tabname = 'VBRP' .
it_fieldcat-ref_fieldname = 'FKIMG' .
it_fieldcat-do_sum = 'X' .
* *it_fieldcat-do_sum = 'x'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
clear it_fieldcat .
it_fieldcat-fieldname = 'NETWR'.
it_fieldcat-seltext_m = 'Invoiced Value'.
it_fieldcat-emphasize = 'X'.
it_fieldcat-ref_tabname = 'VBRP' .
it_fieldcat-ref_fieldname = 'NETWR' .
it_fieldcat-do_sum = 'X' .
* it_fieldcat-do_sum = 'x'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
ENDFORM.
* FORM build_layout *
FORM build_layout.
gr_layout-no_input = 'X'.
gr_layout-colwidth_optimize = 'X'.
gr_layout-totals_text = 'Totals: '(201).
gr_layout-detail_popup = 'X'.
ENDFORM.
* FORM build_event *
FORM build_event.
DATA i_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = gr_events[].
READ TABLE gr_events WITH KEY name = slis_ev_user_command
INTO i_event.
IF sy-subrc = 0.
MOVE gr_user TO i_event-form.
APPEND i_event TO gr_events.
ENDIF.
ENDFORM.
*FORM calc_total.
* LOOP AT it_fieldcat into wa_fieldcat
* WHERE fieldname EQ 'FKIMG' OR
* fieldname EQ 'NETWR'.
* wa_fieldcat-do_sum = 'X'.
* wa_fieldcat-datatype = 'QUAT'.
* modify it_fieldcat from wa_fieldcat.
* ENDLOOP.
*ENDFORM.
FORM build_print.
gr_print-reserve_lines = '2'.
gr_print-no_coverpage = 'X'.
ENDFORM.
* FORM calc_total *
FORM calc_total.
DATA: total TYPE REF TO data,
subtotal1 TYPE REF TO data.
* FIELD-SYMBOLS <fkimg> LIKE sflight.
* FIELD-SYMBOLS <netwr> LIKE sflight.
* CALL METHOD grid1-> get_subtotals
* IMPORTING
* ep_collect00 = subtotal
* ep_collect01 = total.
* ASSIGN total TO <fkimg>.
* ASSIGN total TO <netwr>.
ENDFORM.
*& FUNCTION ALV DISPLAY
FORM display_alv_report.
gr_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gr_repid
i_callback_user_command = slis_ev_user_command
i_callback_top_of_page = 'TOP-OF-PAGE' " see FORM
is_layout = gr_layout
it_fieldcat = it_fieldcat[]
it_special_groups = gr_tab_group
i_save = 'X'
it_events = gr_events
is_print = gr_print
TABLES
t_outtab = i_stocktab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM.
* FORM top-of-page *
FORM top-of-page.
*ALV Header deaclarations
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
t_line LIKE wa_header-info,
ld_lines TYPE i,
ld_linesc TYPE c.
*Title
wa_header-typ = 'H'.
wa_header-info = 'Report for daily Stock Returns'.
APPEND wa_header TO t_header.
CLEAR wa_header.
*Total No. Records Selected
DESCRIBE TABLE i_stocktab LINES ld_lines.
ld_linesc = ld_lines.
CONCATENATE 'Total No. of Records Selected:' ld_linesc
INTO t_line SEPARATED BY space.
wa_header-typ = 'A'.
wa_header-info = t_line.
APPEND wa_header TO t_header.
CLEAR: wa_header, t_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
ENDFORM. -
Suppressing the total row and column in OLAP datagrid
I have created an OLAPDatagrid and everything looks fine
except that I don't want to show the '(All)' row and column in the
grid. Is there a way to suppress them?
Thanks,
FredInstead of using members() in the query use children() for
the attribute/hierarchy. -
How can I select and delete rows based on the value in one column?
I searched through the discussion board, and found a thread on deleting blank rows, but not sure how to modify it to work with my issue.
I have put together a rather complicated spreadsheet for designing control systems, it calculates parts needed based on check boxes selected in a second spreadsheet.
Since not all systems require all parts there are many rows that have a 0 quantity value, I would like to select these rows and delete them once I have gone through the design phase (checking off required features on a separate sheet).
I like the way the other thread I found will gather all the blank rows at the bottom without changing the order of the rows with data in them.
I don't understand exactly how the formula in the other thread works well enough to modify it to look for a certain column.
I hope I made myself clear enough here, to recap, I would like to sort the rows based on a zero value in one (quantity) column, move them (the zero quantity rows) to the bottom of the sheet, and then delete the rows with a zero quantity (I can delete them manually, but would like to automate the sorting part).
Thanks for any help anyone can provide here.
DannyI apologize but, as far as I know, Numbers wasn't designed by Ian Flemming.
There is no "this column will be auto-destructing after two minutes"
You will have to use your fingers to delete it.
I wish to add a last comment :
if your boss has the bad habit to look over your shoulder, it's time to find an other one.
As I am really pig headed, it's what I did. I became my own boss so nobody looked over my shoulder.
Yvan KOENIG (VALLAURIS, France) mercredi 13 juillet 2011 20:30:25
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer ! -
Copy the data from one column to another column using @
I have two columns here - A and B.
Column A has a complicated formula that will generate results. I wanted the results in Column A to be reflected in Column B without pasting the A's formula in B. This will save me the trouble of editing formulas in more than 1 column if there is a need.
I saw somewhere that you can use "@" in column B but I have no idea how to use it.
Assumingly column A is the first column. I tried to insert '@1' in B's formula and change B's column properties' Data Format as "Treat Text as HTML". It does not work.
Please advise how I can do that.So is there any way to copy the data in Column A into Column B without putting the same formula? something like in Excel where we put "=C1". Its not possible in BI as it comes in excel.....The only way is to create a duplicate column in RPD or Answers screen and incorporate the formula and giving different name to it.
whats the problem if you duplicate the column with same formula?....Ok still if you dont want to see identical just write some pseudo logic say
Duplicated column f(x) case when 1=0 then column_name else formula end.....so it appears different to see but it outputs same.
UPDATED POST
Dont create in RPD,you can create a dummy column in that report request and change the f(x) to the above case i mentioned by taking the column from columns button in edit formula screen so when ever you edit the actual column formula that would reflect in the dummy column also as it is replicating from original one.Try and see
hope helps you.
Cheers,
KK
Edited by: Kranthi.K on Jun 2, 2011 1:26 AM -
Can I copy just the info on one column? Not just one cell the whole column?
And then use it to paste into a seperate pages document? I cant find a way to do the whole column just one cell.
Yes, you can! You have to select all the cell in the column. You can do that in several ways, click and drag, OR hold down Shift key and click on each cell in the column.
Why not for the learning Command and click on cells not in the same column or row, and copy and paste to see what happens?! -
Create a new column in a table that compares the value of one column with its previous value
The DDL:
DECLARE
@T TABLE
IDNO
int,
name
varchar(40),
[Date]
datetime2,
Price1
float,
Price2
float
DECLARE
@K TABLE
IDNO
int,
name
varchar(40),
[Date]
datetime2,
Price1
float,
Price2
float
INSERT
INTO @T
VALUES(22,'C_V_Harris','2014-01-02 10:23:49.0000000',
23.335,
23.347)
INSERT
INTO @T
VALUES(21,'C_V_Harris','2014-01-02 10:05:13.0000000',
23.357,
23.369)
INSERT
INTO @T
VALUES(20,'C_V_Harris','2014-01-02 09:56:15.0000000',
23.364,
23.377)
INSERT
INTO @T
VALUES(19,'C_V_Harris','2014-01-02 09:45:26.0000000',
23.351,
23.367)
INSERT
INTO @T
VALUES(18,'C_V_Harris','2014-01-02 09:43:20.0000000',
23.380,
23.396)
INSERT
INTO @T
VALUES(17,'C_V_Harris','2014-01-02 09:34:28.0000000',
23.455,
23.468)
INSERT
INTO @T
VALUES(16,'C_V_Harris','2014-01-02 09:30:37.0000000',
23.474,
23.486)
INSERT
INTO @T
VALUES(15,'C_V_Harris','2014-01-02 09:18:12.0000000',
23.419,
23.431)
INSERT
INTO @T
VALUES(14,'C_V_Harris','2014-01-02 09:16:06.0000000',
23.360,
23.374)
INSERT
INTO @K
SELECT
ROW_NUMBER()
OVER (ORDER
by IDNO)
AS RN,*
FROM
@T
SELECT
* FROM
@K
--not working:
SELECT
a.RN,a.Price2
FROM
@K a
INNER
JOIN @K
b
ON
a.RN=b.RN-1
WHERE
a.Price2>b.Price2
I need to create a view with a column (say 'Comp' below) that compares the value of each row in Price2 with the previous Price2 row, and it is greater then +1, the
same 0, and less -1.
The processed table should be:
IDNO
name
Date
Price1
Price2
Comp
22
C_V_Harris
1/2/2014 10:23:49
23.335
23.347
0
21
C_V_Harris
1/2/2014 10:05:13
23.357
23.369
1
20
C_V_Harris
1/2/2014 9:56:15
23.364
23.377
1
19
C_V_Harris
1/2/2014 9:45:26
23.351
23.367
-1
18
C_V_Harris
1/2/2014 9:43:20
23.38
23.396
1
17
C_V_Harris
1/2/2014 9:34:28
23.455
23.468
1
16
C_V_Harris
1/2/2014 9:30:37
23.474
23.486
1
15
C_V_Harris
1/2/2014 9:18:12
23.419
23.431
-1
14
C_V_Harris
1/2/2014 9:16:06
23.36
23.374
-1
How can I structure the statement to get (the most recent - order by date ) result for Comp?Satheesh Variath, I just had to make some corrections from your script to get the correct answer:
CREATE
VIEW vw_Comp
AS
SELECT
TOP 1 t.IDNO,t.name,t.[Date],t.Price1,t.Price2,
CASE
WHEN t.Price2
> LAG(Price2,1)
OVER (PARTITION
BY name
ORDER BY IDNO)
THEN 1
WHEN t.Price2
< LAG(Price2,1)
OVER (PARTITION
BY name
ORDER BY IDNo)
THEN -1
ELSE 0
END
AS Comp
FROM
@T t
ORDER
BY DATE
DESC
The adjustments: the selection of the most recent comparison (Top 1) and the use of the function LAG (instead of LEAD) to get the previous value of the column.
Maybe you are looking for
-
What is wrong in my store procedure
Hi all, I confuse on in ,out inout in store procedure , I got eroor at Formal parameter '@AccessionNumber' was defined as OUTPUT but the actual parameter not declared OUTPUT I use sql server 2000 and ms type 4 driver, my test store procedure is drop
-
How do I realign my clip after adding widescreen bars?
Hi Everyone, After learning how to add widescreen bars by cropping the top and bottom to what most say is the accorded size of 12% I now have a few clips which are in dier need of adjusting downward so as to not cut off peoples heads haflway. I truly
-
Hi! When using "void thread_id(DbEnv* dbenv, pid_t* pid, db_threadid_t* tid)" callback supply the native thread id to the "db_threadid_t* tid", "int is_alive(DbEnv* dbenv, pid_t pid, db_threadid_t tid, u_int32_t flags)" callback can get the native th
-
I use my iPhone as my alarm clock. When it goes off in the morning I am able to snooze just fine but when I have to get up (finally), I am unable to slide the on/off togle to off. I have to edit and delete the setting then enter a new one. Any sug
-
Reduction of Cost for Asset.
Hi experts, My client wants to reduce the cost of asset and re-run the depreciation run. i.e : They acquired the asset on Jan'2010 for $ 100000 and run the depreciation till Dec'2010. but now they observed that some additional cost wrongly posted to