Select Table row(eg.3rd),rows displayed from the selected row,hiding above
If we move the horizontal scroll bar of the table and filter a column when there is a selection on the row, the rows are displayed from the selected row. The rows above the selected rows are disappearing(F5 it come back) and the rows are available when there are more rows with vertical scroll bar(above the selected row, if we scroll up).
Frank,
Mailed to you the sample application with the table script too. Please review the comments in the mail.
Thanks and Regards,
Stanley William
Edited by: STANLEYWILLIAM on Apr 22, 2013 3:52 PM
Edited by: STANLEYWILLIAM on Apr 22, 2013 3:52 PM
Similar Messages
-
Display only data different from the previous row
Hello,
I will use a simple example to explain what I would like to do with a query.
I have a table 'test' with 4 columns (col1, col2, col3, col4).
The table 'test' contains the following data:
A B C D
A E C D
A F G D
K F G HI would like to create a query ordered on the first column with the following result:
A B C D
E
F G
K HOnly data that are different from the previous row have to be displayed.
Do you have ideas on how to do this.
Thanks for your helpSQL> l
1 select
2 decode(a,lag(a) over (order by a),null,a) a,
3 decode(b,lag(b) over (order by a),null,b) b,
4 decode(c,lag(c) over (order by a),null,c) c,
5 decode(d,lag(d) over (order by a),null,d) d
6 from
7 (
8 select 'A' a,'B' b,'C' c , 'D' d from dual
9 union
10 select 'A' a,'E' b,'C' c , 'D' d from dual
11 union
12 select 'A' a,'F' b,'G' c , 'D' d from dual
13 union
14 select 'K' a,'F' b,'G' c , 'H' d from dual
15* )
SQL> /
A B C D
A B C D
E
F G
K H -
Looping the same answer from the 1st row in the table
I have a database with 3 tables: (1) employeeTable (2) cityTable (3)stateTable.
I reference the employee's city name and state code by each id number from the cityTable and stateTable.
My Employee table has about 10 records, 3 has an idcity and idstate input, the rest are blank.
(1st row) id 9 for Henderson, id 28 for NV (6th row) id 9 for Henderson, id 28 for NV, and (10th row) id 10 for Las Vegas, id 28 for NV
I run a query:
<cfquery datasource="dsnName" name="qEmployees">SELECT * FROM users ORDER BY lastName ASC</cfquery>
<cfquery datasource="dsnName" name="qState">SELECT code FROM states WHERE idstate=#qEmployees.idstate#</cfquery>
<cfquery datasource="dsnName" name="qCity">SELECT name FROM cities WHERE idcities=#qEmployees.idcity#</cfquery>
a run the table output:
<table>
<cfoutput query="qEmployees">
<tr>
<td>#qEmployees.lastName#, #qEmployees.firstName#</td>
<td>#qCity.name#</td>
<td width="40">#qState.code#</td>
<td width="60">#qEmployees.zipCode#</td>
</tr>
</cfoutput>
</table>
PROBLEM:
All 10 records output in the table as the same answer from the 1st row (Henderson, NV).
What's making this loop having the same answer from the 1st row and affects all the rows with blank info or different info?
I've been trying to figure this out for weeks and I hope the community can help me out. Thanks!As Dan rightly says, take a look into table joins; there's no point just giving you the answer as you'll just get stuck next time and these forums are to help people rather than to do their jobs for them.
What you're looking to do is a relatively simple join, so you shouldn't have to read up for long before you've mastered them. Plus your site will be significantly more efficient -
Get Min value and another column value from the same row
hi all - for each customer and product, I need to grab the row that has the min value for field Value1. I could've just done group by on customer and product and min on Value1, but I also need to grab Vlaue2 from the same row where the minimum value for
Value1 lies.
DECLARE @Temp TABLE (CustomerID INT, ProductID VARCHAR(10), Trans_Date Date, Value1 INT, Value2 INT)
INSERT INTO @Temp VALUES (123, 'ABC', '1/1/2013', 10, 100)
INSERT INTO @Temp VALUES (456, 'ASD', '1/1/2013', 40, 500)
INSERT INTO @Temp VALUES (456, 'ASD', '2/1/2013', 90, 700)
INSERT INTO @Temp VALUES (123, 'ABC', '2/1/2013', 20, 700)
SELECT * FROM @Temp
The output should be
123, ABC, 10, 100
456, ASD, 40, 500
I know that I can just join the table to itself and get the desired output but I am dealing with a table that has millions of rows and I was hoping there is more efficient way to do this. any help would be highly appreciated...Here is a correction on your DDL to make it into nearly valid table.
CREATE TABLE Sales
(customer_id INTEGER NOT NULL,
product_id CHAR(10) NOT NULL,
transaction_date DATE NOT NULL,
PRIMARY KEY (customer_id, product_id, transaction_date),
value1 INTEGER NOT NULL,
value2 INTEGER NOT NULL);
Here is the current syntax for insertion:
INSERT INTO Sales
VALUES (123, 'abc', '2013-01-01', 10, 100),
(456, 'asd', '2013-01-01', 40, 500),
(456, 'asd', '2013-02-01', 90, 700),
(123, 'abc', '2013-02-01', 20, 700);
WITH
X
AS
(SELECT customer_id, product_id, transaction_date, value1, value2,
MIN(value1) OVER () AS value1_min
FROM Sales)
SELECT X.*
FROM X
WHERE X.value1_min = X.value1;
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Pick only one row from the repeated rows
Oracle 10g r2 (10.2.0.5)
I have a query/view, which returns the the reords as follows
set colsep ||
Name || Address || Zip
abc123 || Ln1 || 123456
bcd123 || Ln2 || NULL
bcd123 || Null || 45678
efg123 || Ln0 || 96345
efg123 || Ln0123 || Null
efg123 || adr || null
the result set I need from the above is
set colsep ||
Name || Address || Zip
abc123 || Ln1 || 123456
bcd123 || Ln2 || NULL
efg123 || Ln0 || 96345
As you see that the first record on each repeated row sets are required
Thanks,Hi,
Using the aggregate FIRST (or LAST) function like that, there's no guarantee that all of the output values on the same row will come from the same row in the original table. To do that, you can use the analytic ROW_NUMBER function, like this:
WITH got_r_num AS
SELECT name, address, zip, ...
, ROW_NUMBER () OVER ( PARTITION BY name
ORDER BY address
, zip
) AS r_num
FROM table_x
SELECT name, address, zip, ...
FROM got_r_num
WHERE r_num = 1
;This assumes the "first" row is the one with the first address (in alphabetic order), and, in the event of a tie, the one with the lowest zip (however "lowest" is defined for zip). You can specify any order you want in the analytic ORDER BY clause.
I hope that answers your question.
If not, what is your question? Use words other than those you've already used to describe what you want to do.
Explain exactly what "first" means in this problem.Point out where the query above (or the one posted by Claytonian, if that seems closer) is getting the wrong results, and explain how you'd get the right results in those places.
If necessary, post new sample data (either CREATE TABLE and INSERT statements, or a WITH clause, as Claytonian did) and the results you want from that data. -
Please Help, I want to change field value in a table, based on another field value in the same row (for each added row)
I am using this code :
<HTML>
<HEAD>
<SCRIPT>
function addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var colCount = table.rows[0].cells.length;
for(var i=0; i<colCount; i++ ) {
var newcell = row.insertCell(i);
newcell.innerHTML = table.rows[1].cells[i].innerHTML;
switch(newcell.childNodes[0].type) {
case "text":
newcell.childNodes[0].value = "";
break;
case "checkbox":
newcell.childNodes[0].checked = false;
break;
case "select-one":
newcell.childNodes[0].selectedIndex = 0;
break;}}}
function deleteRow(tableID) {
try {var table = document.getElementById(tableID);
var rowCount = table.rows.length;
for(var i=0; i<rowCount; i++) {
var row = table.rows[i];
var chkbox = row.cells[0].childNodes[0];
if(null != chkbox && true == chkbox.checked) {
if(rowCount <= 2) {
alert("Cannot delete all the rows.");
break;}
table.deleteRow(i);
rowCount--;
i--;}}}catch(e) {alert(e);}}
</SCRIPT>
</HEAD>
<BODY>
<INPUT type="button" value="Add Row" onClick="addRow('dataTable')" />
<INPUT type="button" value="Delete Row" onClick="deleteRow('dataTable')" />
<TABLE id="dataTable" width="350px" border="1">
<TR>
<TD width="32"></TD>
<TD width="119" align="center"><strong>Activity</strong></TD>
<TD width="177" align="center"><strong>Cost</strong></TD>
</TR>
<TR>
<TD><INPUT type="checkbox" name="chk"/></TD>
<TD>
<select name="s1" id="s1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</TD>
<TD><input type="text" name="txt1" id="txt1"></TD>
</TR>
</TABLE>
</BODY>
</HTML>Hi,
Let me make sure u r working with table control.
First u have to create a event(VALIDATE) to do the validation.
Inside the event,
1. First get the current index where user has pointed the curson
2. Once u get the index read the internal table with index value.
3. Now u can compare the col1 and col2 values and populate the error message.
1. DATA : lo_elt TYPE REF TO if_wd_context_element,
l_index type i.
lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
CALL METHOD LO_ELT->GET_INDEX( RECEIVING MY_INDEX = l_index.
above code should be written inside the event.
Thanks, -
While Creating New Insert Form Existing Data Display from the Table
Hi
I am New To Sun Java Studio Creator and New to Java Also While Creating New Insert Form Existing Data Display from the Table while i am Run the Form. Can any one help me to Solve this oneDear Giri,
As per your Advise, Literally I have Search the Properties for the Components to set value Null, but I am Unable to find the Value in Properties palate. I have tried in various options like
In the Properties Palate
TextField1_onselect use Value null
TextField1_text I have selected use Value option and I have manually Keyed-in null;
In the JSP Page, I have manually keyed in the null value below said
<ui:textField binding="#{BI.textField2}" id="textField2" style="position: absolute; left: 240px; top: 96px" text="#{BI.bDataProvider.value['ISSUENO'] = null}"/>
<ui:textField binding="#{BI.textField2.Value = null }" id="textField2" style="position: absolute; left: 240px; top: 96px" text="#{BI.bDataProvider.value['ISSUENO'] = null}"/>
At last I am Failure. I am ignorant of it. Can you please help me on this where I have to set null value for the components? I will be very kind of you -
Setfilter to display all the duplicate rows pb7
Friends,
my version is powerbuilder 7.
i am checking the duplicate rows in the datawindow before inserting.
in a button click event...i have the below code
dw_master.SetSort ("rollno A")
dw_master.Sort()
dw_master.SetFilter("rollno = rollno[-1]")
dw_master.Filter()
if dw_master.RowCount() > 0 then
MessageBox('Duplicate Rows','Check the Duplicate Roll numbers',StopSign!,OK!)
Return 1
end if
//no dups, so clear the filter and do the update...
dw_master.SetFilter ("")
dw_master.Filter()
i have 2 duplicate rows...but this setfilter is displaying only one row....
if it displays all the duplicate rows then it will be very useful for me...
how can i modify this code to get all the duplicate rows in this datawindow before inserting?
thanksInstead of a filter you could do this...
boolean lb_dupe_found=false
long ll_row, ll_rowcount
string ls_val1, ls_val2
ll_rowcount = dw_1.rowcount()
for ll_row = 2 to ll_rowcount
ls_val1 = dw_1.getitemstring(ll_row, 'col1')
ls_val2 = dw_1.getitemstring(ll_row -1, 'col1')
if ls_val1 = ls_val2 then
// duplicate
lb_dupe_found = true
exit
end if
next
if lb_dupe_found then
messagebox('DUPE', 'Houston we have a problem!')
else
messagebox('SAVE', 'Data valid for saving')
end if -
Grand total level of the percentage column giving value from the first row of column
Hi Guys,
I have a requirement like to show the percentage value which the calculation of two columns , in the grand total level .
I think it can be achievaable by giving the aggregation rule for that column as Server complex Aggregate .
eg.
Fiscal Year Department subdepartment Total cost Sub Department cost % cost
2011 Edu Books 500 50 10
2011 Edu Note Book 200 100 50
2011 Edu Furniture 300 30 10
2011 Edu 1000 180 18
Grand Total
Ideally it should come like as above ..but the problem with me that ,it showing correct value for all the rows ,but at the grand total level it's taking the value of % cost from the first row . like below..
2011 Edu 1000 180 10
Grand Total
I have calculated the % cost column in the answer itself as (Sub Department cost /Total Cost )
where the
Aggregation rule for the columns given are
Total Cost - Sum ,Sub Dep Cost - Sum, % Cost - Server Complex Aggregate
So plz suggest me any Idea to achieve this ..Thanks in advance.Give the agg. as avg for % field.
Best of Luck,
Kashi -
Retrieve input values from the selection screen
I have a requirement to retrieve the variable value or values inputed from the selection screen and label the worksheet tab to replace the tab name 'Sheet1' from the Excel. The only way to do this would be to write a macro to label the sheets but how would I retrieve the value(s) from the selection screen criteria? Is the value of the selection screen entered by the user stored in some table? How would I write the macro to retrieve this value?
For example, I want to retrieve the company code entered from the selection screen and lets say the company code entered as 10; I would want to replace the worksheet from 'Sheet1' to '10' . Texts would be more recognizable.Use the option Layout->Display Text Elements->Variables from the BEx toolbar. This will display Variable screen user input on your workbook in a fixed location. Then you can use your macro to name the worksheet with the cell reference.
Thanks
Vineet -
How to processing the results from the select statement in SQL query?
Hi
This might be too simple, but my knowledge of the SQL is very limited...
I have table where I do have details from calls (Lync QoE).
I can take all calls from the table, but I would like to count the concurrent calls on the table. This is how I got it work on the Excel to work (but I would like to do that on the SQL statement to get it more dynamic use):
Table have these line and this is what I get out from the Select):
[callid],[start],[end]
1ABC,1.1.2014 01:00:15, 1.1.2014 01:01:00
5DEF,1.1.2014 01:00:45, 1.1.2014 01:05:00
FDE2,1.1.2014 01:03:15, 1.1.2014 01:04:00
KDJ8,1.1.2014 01:04:15, 1.1.2014 01:06:00
FDJ8,2.1.2014 01:04:15, 2.1.2014 01:06:00
KDSE,3.1.2014 01:04:15, 3.1.2014 01:06:00
The information I would like to get, is what is the maximum amount of the concurrent calls per day.
On the excel I basically count line by line how many concurrent calls each line have had, and then pickup the highest one. On above example the calls 5DEF, FDE2 and FDE2 have been active at the same time which gives 3 for the first day.
The table is ordered by the start. So let say the code is on the third line (FDE2). I need to count calls from before which end time is after the start time (of FDE2), but also I need to count calls after (FDE2) which are started before the current
call has ended.
PetriUnfortunately your post is off topic as it's not specific to SQL Server Samples and Community Projects.
This is a standard response I’ve written in advance to help the many people who post their question in this forum in error, but please don’t ignore it. The links I provide below will help you determine the right forum to ask your question in.
For technical issues with Microsoft products that you would run into as an end user, please visit the Microsoft Answers forum ( http://answers.microsoft.com ) which has sections for Windows, Hotmail,
Office, IE, and other products.
For Technical issues with Microsoft products that you might have as an IT professional (like technical installation issues, or other IT issues), please head to the TechNet Discussion forums at http://social.technet.microsoft.com/forums/en-us, and
search for your product name.
For issues with products you might have as a Developer (like how to talk to APIs, what version of software do what, or other developer issues), please head to the MSDN discussion forums at http://social.msdn.microsoft.com/forums/en-us, and
search for your product or issue.
If you’re asking a question particularly about one of the Microsoft Dynamics products, a great place to start is here: http://community.dynamics.com/
If you think your issue is related to SQL Server Samples and Community Projects and I've flagged it as Off-topic, I apologise. Please repost your question and include as much detail as possible about your problem so that someone can assist you further.
If you really have no idea where to post your question please visit the Where is the forum for…? forum http://social.msdn.microsoft.com/forums/en-us/whatforum/
When you see answers and helpful posts, please click Vote As Helpful,
Propose As Answer, and/or Mark As Answer
Jeff Wharton
MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCSD, MCSA, MCITP, MCDBA
Blog: Mr. Wharty's Ramblings
Twitter: @Mr_Wharty
MC ID:
Microsoft Transcript -
Getting Tag and value from the selected Xml element value
Hi All,
I have an xml file which i import to the Indesign CS3 .From the structure view , i drag and drop the root node on to the page. Now i select an xml value from the page. Now i need to get the element tag and value from the selected value.
For example
File Name : sample1.xml
<Root>
<employeeName> A</employeeName>
<employeeEmail>[email protected]</employeeEmail>
</Root>
Now i import this sample.xml in my indesign CS3 and from the structure view i drag the Root tag and drop it on the page.Now the values of the element tag are displayed.
Now i select "[email protected]" from the page and i have a menu "Get Selected XML" on clicking which i should get element tag with value.(i.e <employeeEmail>[email protected]</employeeEmail>)
How to go about it.?
Thanks
SakthiHi Steve,
If you haven't already done so, I recommend posting this question in the LivCycle Forms forum.
Jared -
Issue In Providing 255 Charcters From The Selection Screen Select-Option
Dear Guru,
I am searching for table field with having length = 255 character.
which i want to use in select-option for proving data from the selection screen.
I have found the table myhlp and it associated field allvals which is having length = 255.
I am using it as below in my selection screen for the value to be provided 255 character long.
SELECTION-SCREEN : BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
SELECT-OPTIONS : s_mlbody FOR myhlp-allvals NO INTERVALS.
SELECTION-SCREEN : END OF BLOCK b3.
Now when i am going for the multiple selection option --> It is providing me the Multiple selection popup and giving me the provision of provide multiple line .
But the issue is that --> For a particular single value line in the popup i am able to enter only 45 charcters not 255 character.
But i need to put 255 charcter for particular line in a single value..
Please give me some guideline how resolve this or any other alternative way of reading the 255 charcter from the selection screen
Thanks & regards
Saifur RahamanHi,
As said by A@s selction screen with table control will be a good option.
design a custom screen with SUBSCREEN as screeen attribute using tcode se51.
For table control sample - go through Tcode ABAPDOCU - abap user dialogs-screens-complex screen- table control
Try Following,
REPORT Zsample .
controls: tc type tableview using screen 200.
parameters: p_user type myhlp-username.
data: begin of itab occurs 50,
field1(255) type c,
end of itab.
data: i_out type standard table of myhlp.
SELECTION-SCREEN BEGIN OF TABBED BLOCK MAX FOR 22 LINES.
SELECTION-SCREEN TAB (25) TABS1 USER-COMMAND UCOMM1
DEFAULT SCREEN 200.
SELECTION-SCREEN END OF BLOCK MAX.
start-of-selection.
select * from myhlp into table i_out for all entries in itab
where username eq p_user
and allvals = itab-field1.
MODULE READ_ITAB INPUT.
insert itab index tc-current_line.
ENDMODULE. " READ_ITAB INPUT -
ArchLinuxForums_Suck wrote:
Hey, I'm new to Arch and I've been working on setting it up on my Laptop and so far I haven't had very many problems save one. I can't get any of the available Window Managers. Whenever I try running them I get a message like:
"wmii: fatal: Can't open display," or "Error: Couldn't connect to XServer" (Fluxbox), or "twm: unable to open display" or "dwm: cannot open display" or "Openbox-Message: Failed to open display from the DISPLAY environment variable,". What am I supposed to do? I've checked to see if it was a problem with my installation of Openbox by reinstalling that and installing several other window managers, and I've checked to see if it was a problem with me not having the right kernel modules loaded, but after I ran "hwdetect --load-modules," which is supposed to load all detectable modules, but even after that I still get the same messages. Any ideas, I've tried just about everything that I know\have thought about, so yeah... any ideas?
ngoonee wrote:You'd need to provide us with details on your system. For example, what GPU are you using? hwdetect can be hit-and-miss sometimes.
karol wrote:How exactly are you trying to run them? Are you trying to run them as root? Are you using .xinitrc? If so, post it.
Boxes wrote:Uh... I try running them by typing: "openbox" or "twm" or "wmii" or "xinit openbox-session", and when I run "xinit" by itself, I get this: ". . . (EE) Failed to load module 'glx' (module does not exist, 0), (EE) Failed to load module 'intel' (module dose not exist, 0), (EE) Failed to load module 'vesa' (module does not exist, 0), (EE) Failed to load module 'fbdev' (module does not exist, 0), (EE) No drives available." Oh, and nGone I'm running an Intel Mobile 4 Chipset. I don't have a GPU. I just have an Intel Graphics Controller.
Boxes wrote:Okay, well I got "xinit openbox" to work by searching for the "intel," "vesa," "fbdev," and "glx" packages via pacman and installing them. I still can't run openbox without xinit, and I tried running "xinit wmii," but it didn't seem to work, although it did run, but I couldn't do anything. It looked exactly the same was as "xinit openbox" did right after I installed "vesa," which was the first package I downloaded and installed via pacman.
tomk wrote:
You need to read a bit more about how X works - you can't run any window manager unless there's a X session for it to run on. That's why xinit works. Set up your ~/.xinitrc correctly and use startx.
xinit wmii ran a wmii session, but I guess you didn't configure it at all - that's why you couldn't do anything. Again, more reading required.Oh, I see. So an X-session is something that's required. Oh, okay.
-
Choosing a directory from the selection-screen
Hi,
regarding: select-options
There is a function module to choose a file (on value request F4) from the harddisc =>KD_GET_FILENAME_ON_F4
I want the user to choose his path(folder) from the selection screen.
Is there any function module to choose only the <b>directory(path) not the file</b>?
Thanks and Regards.Hi Ashok,
You can alternatively do the following. Call the method of class CL_GUI_FRONTEND_SERVICES as follows.
Call Method CL_GUI_FRONTEND_SERVICES-->DIRECTORY_BROWSE
Exporting
WINDOW_TITLE =
INITIAL_FOLDER =
SELECTED_FOLDER =
Hope this helps.
Please reward some points if it helps you.
Regards,
Amit M. Mishra
Maybe you are looking for
-
Hi , i have a requirement to print all the values as a report. say i have a page. For each value i have a check box. oN select of the checkboxes the values needs to be printed. How do i proceed on this? the report should be displayed as PDF. what sho
-
IPad 2 fully connected to Wi-Fi and a VPN, but not getting any internet access
I'm on iOS 8.3 using an iPad 2, and the other day out of nowhere, I stopped getting internet connection to my iPad. I am still connected to my WiFi network as well as a VPN I was using before I lost internet connection (which is weird, as I figured I
-
I cant open my current photo library using this version of iphoto 09
This is the error I get when I click on upgrade after I installed Iphoto 09 "You cant open your current photo library using this version of iphots, You have made changes to your photo library using a newer version of iPhoto. Please quit and use the l
-
Storing archive device info in the asset.
If I restore an asset, first of all I need to keep the original directory structure, WHY??? And secondly, FCS deletes it from that archive... WHY??? And if I want to copy it back to that archive device after I have used it, I have no information from
-
Error install software on Windows Sever 2012
Hello! I'm using a VPS Cloud. used OS Windows Sever 2012. I can not install any software on it. Simple as firefox, error: Cloud not find...runtime or adobe flash player...ect. Please help me install. Thank you Regards Danny |