How to get Header Column Content based on MIN or RANK
Hey Everyone,
I am trying to grab the header content based off of the lowest of three values.
If I have:
How do i get the column header of the lowest price?
I tried VLOOKUP and MIN and RANK. And is its easier can I just rank the with the column header in each cell?
Like:
Company X - $1.00
Company Y - $2.00
Company Z - $3.00
jjmancini wrote:
What i would like to have ideally is for the right most column to rank in each column from lowest to highest.
Example of last Column:
1) $1.00 - Company X
2) $2.00 - Company Y
3) $3.00 - Company Z
That would be the ideal solution.
At least three, Yvan.
I'm still not clear what this result is ranking, jj. That's partly due to the sample data in your table:
The results shown are both the rankings of the prices in row 2 and the rankings of the lowest prices in each column. Which is it you are looking for? I've assumed you want to compare prices in each row.
Second complication: In the column 1 header, the content is "Price Company X"; in the Example of last Column, the resulting text, which you want picked up from that header is "Company X".
While that's not too difficult to pick off for the examples, where each 'company name' has exactly 9 characters, the simple solution won't work for 'real' companies. Placing the exact text you want copied into this row would simplify the task. See example below.
Third complication: Although A2 on your sample shows "1.00", the actual content of the cell is "1", and the ".00" is added to the display by setting format for the cell. When picked off by a function, only the value is picked up, and it's that value that's available to the formula constructing the text string in the last column. I've avoided that by placing the company name and the price in separate cells.
Formulas:
Auxiliary table: A3: =SMALL(Main :: $B3:$D3,COLUMN())
Fill right to column C. Fill Down to row 12 (to match Main table's data rows).
Main Table: F3: =Auxiliary :: $A3
Main Table: H3: =Auxiliary :: $B3
Main Table: J3: =Auxiliary :: $C3
Construct each of these three separately.
Main Table: E3: =LOOKUP(F3,$B3:$D3,$B$2:$D$2)
After clicking Accept, Copy cell E3, then select and Paste in G3 and I3.
Pasted formulas will be the same except for the F3 reference.
After placing these formulas, select cells E3:J3 and fill down to row 12.
The Auxiliary table is used to sort the prices, and may be hidden. It may also be eliminated by replacing the formulas in F3, H3 and J3 with
F3: =SMALL($B3:$D3,1)
H3: =SMALL($B3:$D3,2)
J3: =SMALL($B3:$D3,3)
Formatting will need to be reset for these columns.
Regards,
Barry
Similar Messages
-
How to get the column names of the table into the Dashboard prompt
how to get the column names of the table into the Dashboard prompt
Thanks & Regards
Kishore PHey john,
My requirement is as follows
I have created a Rank for Total sales by Region wise i.e RANK(SUM(Dollars By Region)) in a pivot table.
My pivot table looks like this
COLUMN SELECTOR: TOTAL US , REGION , DISTRICT , MARKET
---------------------------------------------------- JAN 2009 FEB 2009 MAR 2009
RANK REGION DOLLARS DOLLARS DOLLARS DOLLARS
1 CENTRAL 10 20 30 40
2 SOUTHERN 10 30 30 70
3 EASTERN 20 20 20 60
4 WESTERN 10 20 30 40
When i select the District in column selector
Report has to display rank based on Total Sales by District. i.e
------------------------------------------------- JAN 2009 FEB 2009 MAR 2009
RANK DISTRICT DOLLARS DOLLARS DOLLARS DOLLARS
for this i need to change the fx of rank i.e RANK(SUM(Dollars By Region)) to RANK(SUM(Dollars By District)) and fx of Region i.e Markets.Region to Markets.District dynamically.
so , i need to capture column name of the value selected from the column selector and dynamically i need to update the fx 0f RANK & fx of region.
do you have any solution for this?
http://rapidshare.com/files/402337112/Presentation1.jpg.html
Thanks & Regards
Edited by: Kishore P on Jun 24, 2010 7:24 PM
Edited by: Kishore P on Jun 24, 2010 7:28 PM -
How to get summary columns in delimited text file
How to get summary columns in delimited text file
I am trying to generate a delimited text file output with delimited_hdr = no.The report is a Group above report with summary columns at the bottom.In the text file the headers are not getting repeated & thats ok.The problem is the summary data is getting repeated for each row of data.Is there a way where i will get all the data & summary data will get displayed only once.I have to import the delimited text file in excel spreadsheet.Sorry there were a typos :
When I used desformat=DELIMITEDDATA with desttype=FILE, I get error "unknown printer driver DELIMITEDDATA". When you look for help, DELIMITED is not even listed as one of the values for DESTFORMAT. But if you scroll down and look for DELIMITER it says , this works only in conjuction with DESTFORMAT=DELIMITED !!!!!!??!! This is in 9i.
Has this thing worked for anybody ? Can anyone please tell if they were able to suppress the sumary columns or the parent columns of a master-detail data for that matter ? -
How to get the column index inside a dataTable
Hello,
before I get staked, there are multiple threads handling familiar topics to the one I'm questioning about but none gives an anwer. If there is one, I'm propably to less skilled to see it.
So here is my Problem: I've build a web-interface to a time-recording system. The hours worked on a certain project are displayed in a dataTable component which is generated out of a mySQL Query. Each entry (column/row) contains a inputText component to display and edit the specific value.
Editing one of these inputText elements now fires a valueChangeEvent which reads the new value and stores it in the database. For that cause I need to know the row- and column-index of the inputText component that fired the event.
Using the getClientId method from the valueChangeEvent I get some Information which makes it possible to calculate the row/column index. A typical clientID looks like "form_table:mainTable:0:_id14". "form_table" is the ID of the form the dataTable is in. "mainTable" is the id of the dataTable component. "0" is the row the component is in. And finally "_id14" stands for the id randomly given to the inputText component by JSF.
My Problem is now, that though I can calculate the column out of the[i] "_id14", this calculation is hardcoded. So everytime I add a component in before the dataTable, the calculation needs to be adjusted in the code.
The Questions:
- How to force a sensefull id indicating a column-index for the inputText components inside the columns of a dataTable?
- Nicer since no workaround: How to get the column-index inside the dataTable on a natural way? (e.g. out of the valueChangeEvent the specific inputText component fires)
After some investigation here on the board and on the net I know multiple ways to get the row index, (Things like component-binding and so on) but I can't find a answer on how to get the column-index.
Thanks to all answers and/or links to things my eyes missed while searching for one....then index 0 becomes index 1 and my program doesn't work properlyThe program works properly, just not as you expect it to.
As you've noticed the table gives you the flexibility to move columns around. So if you move column 0 to column 1, why would you expect to still use 0 as the index? The table manages the reordering of columns for you to make sure the data being displayed in each table column comes from the correct column in the data model.
You can manage this yourself using one of the following methods (I forget which one):
table.convertColumnIndexToModel(int viewColumnIndex)
table.convertColumnIndexToView(int modelColumnIndex)
Or, you can get data from the data model directly:
table.getModel().getValueAt(row, 0); -
How to get Header in Downloaded .xls file using GUI_Download function
How to get Header in Downloaded .xls file using GUI_Download function ???
How to use the the Header parameter available in GUI_Download function .HI,
see this sample code..
data : Begin of t_header occurs 0,
name(30) type c,
end of t_header.
data : Begin of itab occurs 0,
fld1 type char10,
fld2 type char10,
fld3 type char10,
end of itab.
DATA: v_pass_path TYPE string.
append itab.
itab-fld1 = 'Hi'.
itab-fld2 = 'hello'.
itab-fld3 = 'welcome'.
append itab.
append itab.
append itab.
append itab.
append itab.
t_header-name = 'Field1'.
append t_header.
t_header-name = 'Field2'.
append t_header.
t_header-name = 'Field3'.
append t_header.
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
default_extension = 'XLS'
IMPORTING
fullpath = v_pass_path.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_pass_path
filetype = 'DBF'
TABLES
data_tab = itab
FIELDNAMES = t_header
Cheers,
jose. -
How to get(copy) the contents i.e the cell of an excel sheet to other excel
How to get(copy) the contents i.e the cells of an excel sheet to another excel sheet.
I can read the contents i.e the text in the cells and able to display it in the Java console
i want these contents to be copied to another excel sheet with the cells data.
I am using Java Swing for the UI, POI framework for the excel work.
Please anyone suggest some code to this requirement.[spreadsheets with poi|http://poi.apache.org/spreadsheet/converting.html] Hi
on the poi apache site there's a number of good examples...
I started with poi only a week ago, but just from reading these examples
(especially SS Usermodel code) i managed all i needed to know (so far).
kind regards
BB
Edited by: BugBunny on Feb 22, 2010 4:36 AM -
How to get header data in ME_PROCESS_REQ_CUST
Hi all,
how to get header data in badi ME_PROCESS_REQ_CUST-process_itemIsn't it available in the parameters of the method that you are tyring to write.
Regards,
Ravi
Note - Please mark all the helpful answers -
How to get head of the department(HOD) as an approver.
Hi Experts,
Existing scenario:
Created travel(international) request after getting approved by 1st level(line-manager) work item will go for next level(final approver Line exco).
existing code is attached.
To be developed Scenario:
After getting approved by 1st level (line-manager) work item will go 2nd level (Head odf hte department) prior to final approval(line-exco).
Please suggest me how to get Head of the department using bellow logic.
Pick the ORGEH ( Org unit) as on 31.12.9999 and pass it to HRP1001 with the following field values
RSIGN A
RELAT 803
And pick the SOBID ID as on 31.12.9999
Now pass the SOBID in table HRP1001 , and pass the data with the following field values
OTYPE – O
OBJID – same as SOBID
RSIGN B
RELAT 012
Pick the SOBID
Now pass the SOBID to HRP1001 and
RSIGN A
RELAT 0008
SOBID : PERNR
Pass the PERNR in PA0105 pick the data against SUBTY 0001 .
Thanks in advance
Goutamwhy not use an HR evaluation path (transaction OOAW see for example WF_ORGUN ) and read the path with RH_STRUC_GET function module?
https://help.sap.com/saphelp_erp60_sp/helpdata/en/c5/e4b2c8453d11d189430000e829fbbd/frameset.htm -
How to get last column used in report sorting?
hi,
how to get last column used in report sorting?
simonHow to identifiy which column was sorted having different reports on page?
just use:
'YOUR_STATIC_REGION_NAME' instead of p_static_id,
:APP_ID for p_app_id,
:APP_PAGE_ID for p_page_id
:APP_USER_ID for p_app_user.
and dont forget to grant SELECT on #OWNER# to APEX_030200.WWV_FLOW_PREFERENCES$
good luck and thank you Juergen.Schuster
Simon -
How to get the pricing hierarchy based on the delivery date for sales order
Hi,
How to get the pricing hierarchy based on the delivery date for sales order other than system date.
My requirement is to get the Pricing hierarchy based on the delivery date other than system date.
Waiting for kind response.
Best Regards,
BDPHI Sai,
please refer teh document already how to write FM based extration on generic extractors.
and here the logic to find the latest records values:-
-> get the data in an internal table
->Sort the internal table data based from date descending
-> Using READ statement , we can read the first record of the table which is nothign but your latest record.
Regards.
Sakthi -
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. -
hi
i am new to programming... i would like to know how to get the column values... i have a resultset object
i need code .... asap
thnx@OP: It is always good to type complete sentences and describe your problem at length. It helps in letting people know what you really need instead of making wild guesses or silly jokes. You post mentions that you get the ResultSet. Then you should look up the API docs for java.sql.ResultSet and take a look at the getxxx() method signatures. Use the ones which suit the specific case.
Besides, it is good to refrain from using asap and urgent. Even if something is urgent to you, it need not be urgent to others. Wording a question properly would attract better replies.
Finally, would you mind getting down to specifics of your problem? From what I perceived, the JDBC tutorial and the API docs should provide all the information you need. -
How to get the SQL queries based on SQL_ID.
Hi Experts,
I want to get the SQL queries based on SQL_ID.
I have tried the following query,but I am not getting full query.
[code]SET linesize 132 pagesize 999
column sql_fulltext format a60 word_wrap
break on sql_text skip 1
SELECT REPLACE (TRANSLATE (sql_text, '0123456789', '999999999'), '9', ''),sql_id
FROM dba_hist_sqltext s
WHERE s.sql_id = '7tvurftg8zryb';[/code]
One of my friend said use grid to get full query text.
Can you please help me how to use grid ,else any other method to get the full query based on SQL_ID.
Please help me.
Thanks in advance.You have these many options to set, if sql_text is really huge. But better use a tool(TOAD) as it's really helpful and easy to use instead! (See my previous comment).
column sql_text format A10000
set echo off
set head off
set feed off
set verify off
set termout off
set lines 10000
set long 1000000
set trimspool on
set pages 0
Thanks! -
Reading csv file how to get the Column name
Hi,
I am trying to read a csv file and then save the data to Oracle.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection("jdbc:odbc:;Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=.;Extensions=csv,txn");
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery("select * from filename.csv");
while(rs.next())
System.out.println(rs.getString("Num"));
My csv file looks like this:
"CHAM-23","COMPANY NAME","Test","12",20031213,15,16
Number,Environ,Envel,Date,Time
"1","2",3,"4",5
"6","7",8,"9",9
Now is there anyway using the above code I start processing the file from the second row that holds the names of the columns and skip the first row. And also can I get the name of the column using ResultSet something like:
if columnName.equals("Number")
Because I may have a csv file that could have more columns:
"CHAM-24","COMPANY NAME","Test","12",20031213,16,76
Number,Environ,Envel,Date,Time,Total,Count
"1","2","3","4","5",3,9
"6","7","8","9",9",,2
So I want to get the column name and then based on that column I do some other processing.
Once I read the value of each row I want to save the data to an Oracle Table. How do I connect to Oracle from my Application. As the database is on the server. Any help is really appreciated. ThanksThe only thing I could think of (and this is a cluj) would be to attempt to parse the first element of each row as a number. If it fails, you do not have a column name row. You are counting on the fact that you will never have a column name that is a number in the first position.
However, I agree that not always placing the headers in the same location is asking for trouble. If you have control over the file, format it how you want. If someone else has control over the file, find out why they are doing it that way. Maybe there is a "magic" number in the first row telling you where to jump.
Also, I would not use ODBC to simply parse a CSV file. If the file is formatted identically to Microsoft's format (headers in first row, all subsequent rows have same number of columns), then it's fine to take a shortcut and not write your own parser. But if the file is not adhering to that format, don't both using the M$ ODBC driver.
- Saish
"My karma ran over your dogma." - Anon -
How to get each column position in JTable?
I want some buttons appear at the top of each column. For example,
Button1 Button2 Button3
| column1 | column2 | column3 |
|--------------------------------------------|
...But button1,2 and 3 should be at the top of the column1, 2 and 3. So the problem is that how can I get each column's position.gajesh wrote:
To get column index using column heading name, use following:-
table.getColumnModel().getColumnIndex(columnName)You should use your own TableCellRenderer for header column:
MyButtonHeaderRenderer extends JButton implements TableCellRenderer {
<class definition>
then you can set user-defined renderer to header column:-
getColumnModel().getColumn(colIndex).setHeaderRenderer(new MyButtonHeaderRenderer());
But the button is outside of the JTable. It is on the top of the Table. So I don't think implementing HeaderRender works here.
I need to know each column's position (x,y) and place the button on the top of the columns.
Maybe you are looking for
-
Interest calculation in Dunning Wizard
Hi All, I have a question with regard to the calculation of Interest amount via Dunning wizard. Let us say I have a dunning term that issues Dunning Letter 1, 30 days past the due date. Dunning Letter 2 is issued 30 days past the dunning letter 1. Th
-
In BDT , Can we have custom container in BDT subscreen
Hello Techies, Can we have a custom control in BDT Subscreen, just as calender picking tool in the screen. I appreciate ur valuable inputs Thanks Santhosh Moderator message - Cross post locked Edited by: Rob Burbank on Apr 14, 2009 10:43 AM
-
Huge latency reading quadrature encoders
I'm using a PCI-6601 to read two quadrature encoders on a pan-tilt mechanism. The software uses the DAQmx C interface and polls the encoder positions at 200Hz. The problem is that there appears to be a huge latency on the order of ~50msec between whe
-
Can I watch my slideshows on my television via a USB cable and if so how
I'm new to Apple so still learning! I wold like to view my slideshows on my television via an USB cable is this possible and how do I do it ?
-
<p>Hi,</p><p> I am sorry i am writing it out here but i justwanted to discuss with you all that I have a fulltime positionwith Wachovia for Hyperion Developer. let me know if anyone of youis interested in it. This position is fulltime position with