Range and rows
Hi folks,
I never used range or rows before in analytic functions. I took some time to learn a bit about them but cant figure out why would you need to use it? Most of the things I needed I got from lead or lag functions. So whats the deal with window functions? Where are they useful?
Best regards,
Igor
Hi, Igor,
Igor S. wrote:
Hi folks,
I never used range or rows before in analytic functions. I took some time to learn a bit about them but cant figure out why would you need to use it? Most of the things I needed I got from lead or lag functions. So whats the deal with window functions? Where are they useful?What do you mean by "window function"?
That term most commonly refers to functions that allow you to specify a window of consecutive rows in your data set, and the function will operate on the rows within that window. In that sense, most analytic functions are window functions.
The default window is RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW. You only need to specify a windowing clause (that is, RANGE or ROWS) if you want to override that.
For example, the following query shows the average salary from the scott.emp table, and the number of salaries that contribute to that average, two different ways. The columns cnt_sal and avg_sal use the default windowing, so the figures on each row include that row itself, and all earlier rows (where hiredate determines what is earlier). The columns cnt_60 and avg_60 include only the 60 days up to, but not including, the row itself. Notice that sometimes there are 0 rows in that window.
SELECT ename
, hiredate
, sal
, COUNT (sal) OVER ( ORDER BY hiredate ) AS cnt_sal
, AVG (sal) OVER ( ORDER BY hiredate ) AS avg_sal
, COUNT (sal) OVER ( ORDER BY hiredate
RANGE BETWEEN 61 PRECEDING
AND 1 PRECEDING
) AS cnt_sal_60
, AVG (sal) OVER ( ORDER BY hiredate
RANGE BETWEEN 61 PRECEDING
AND 1 PRECEDING
) AS avg_sal_60
FROM scott.emp
ORDER BY hiredate
;Notice that the formula for cnt_sal is exactly the same as the formula for cnt_sal, except that cnt_sal_60 specifies a RANGE. The same goes for avg_sal and avg_sal_60.
Output:
ENAME HIREDATE SAL CNT_SAL AVG_SAL CNT_SAL_60 AVG_SAL_60
SMITH 17-DEC-80 800 1 800 0
ALLEN 20-FEB-81 1600 2 1200 0
WARD 22-FEB-81 1250 3 1216.66667 1 1600
JONES 02-APR-81 2975 4 1656.25 2 1425
BLAKE 01-MAY-81 2850 5 1895 1 2975
CLARK 09-JUN-81 2450 6 1987.5 1 2850
TURNER 08-SEP-81 1500 7 1917.85714 0
MARTIN 28-SEP-81 1250 8 1834.375 1 1500
KING 17-NOV-81 5000 9 2186.11111 1 1250
JAMES 03-DEC-81 950 11 2147.72727 1 5000
FORD 03-DEC-81 3000 11 2147.72727 1 5000
MILLER 23-JAN-82 1300 12 2077.08333 2 1975
SCOTT 19-APR-87 3000 13 2148.07692 0
ADAMS 23-MAY-87 1100 14 2073.21429 1 3000Edited by: Frank Kulash on Apr 3, 2013 9:16 AM
Added example from scott.emp
Similar Messages
-
How do I select a range of rows from an internal table in the debugger?
Hi,
I have a case where I wanted to delete a range of rows (several thousand) from an internal table using the debugger.
It seems that rows can only be selected one at a time by selecting (clicking) on the far left side of the row.
This is cumbersome, if not impossible when wishing to delete several thousand rows.
Other tools, such as Excel for example, allow for selecting a range of rows by selecting the first row and then holding the SHIFT key and selecting the last row and all rows in between will be selected.
I can't seem to find the combination of keys that will allow this in the table (or structure) tab of the debugger.
Is it possible to select a range of rows without having to select each row one at a time?
Thanks for your help,
AndyWhile it's a Table Control and should/could have a button to select all fields (or visible fields)...I don't think we can do it right now...I know it's a pain to select each row one at a time...but I don't we have any more options...
Greetings,
Blag. -
Finding missed sequence numbers and rows from a fact table
Finding missed sequence numbers and rows from a fact table
Hi
I am working on an OLAP date cube with the following schema:
As you can see there is a fact transaction with two dimensions called cardNumber and Sequence. Card dimension contains about three million card numbers.
Sequence dimension contains a sequence number from 0 to 255. Fact transaction contains about 400 million transactions of those cards.
Each transaction has a sequence number in 0 to 255 ranges. If sequence number of transactions of a card reaches to 255 the next transaction would get 0 as a sequence number.
For example if a card has 1000 transactions then sequence numbers are as follows;
Transaction 1 to transaction 256 with sequences from 0 to 255
Transaction 257 to transaction 512 with sequences from 0 to 255
Transaction 513 to transaction 768 with sequences from 0 to 255
Transaction 769 to transaction 1000 with sequences from 0 to 231
The problem is that:
Sometimes there are several missed transactions. For example instead of sequence from 0 to 255, sequences are from 0 to 150 and then from 160 to 255. Here 10 transactions have been missed.
How can I find all missed transactions of all cards with a MDX QUERY?
I really appreciate for helpsThank you Liao
I need to find missed numbers, In this scenario I want the query to tell the missed numbers are: 151,152,153,154,155,156,157,158,159
Relative transactions are also missed, so I think it is impossible to get them by your MDX query
Suppose this:
date
time
sequence
20140701
23:22:00
149
20140701
23:44:00
150
20140702
8:30:00
160
20140702
9:30:00
161
20140702
11:30:00
162
20140702
11:45:00
163
As you can see the sequence number of the last transaction at the 20140701 is 150
We expecting that the first transaction of the next day should be 151 but it is 160. Those 10 transactions are totally missed and we just need to
find missed sequence numbers -
ALV display column and row wise
hi experts,
Is it possible to display in ALV display as 6 fields in column and some ranges in row display so how to display that using alv grid any sample report please do send me.
e.g.display format.
PO Type Shipping Date Invoice Num PCS # Po No. Cust Name Terms Open Balance
Current
Total Current
1 - 15
Total 1 - 15
16-30
Total 16-30
31 - 60
Total 31 - 60
61 - 90
Total 61 - 90
> 90
Total > 90
TOTALhi Lakshman,
i want report for customer open invoices that is aging report,
so depens on due days as per ranges shown in my question like 1--15 days,
15-16 days these are due days ranges , and i have display these related ranges records horizontally , just understand my display format u will get what i mean to say,
please send me any proper solution.
Thanks and Regards,
Yogesh -
Transpose columns and rows in numbers
I need to transpose columns and rows in Numbers and I do not want to write script to do it. Is there an easier way?
Give me a proper transpose and I will uninstall Excel and never look back.
Ok, here's a proper transpose, that can be placed in an Automator Service so it becomes a simple menu pick as below (and can also be assigned a keyboard shortcut).
To use it (this is slightly different from Excel) you select the range you want to transpose, choose Copy Transpose, click a destination cell in an existing table in the current document or another document, and command-v (Edit > Paste) or option-shift-command-v (Edit > Paste and Match Style).
The one-time setup is as follows. In Automator choose File > New > Service, drag a Run AppleScript action from the left into the right pane, choose 'No Input' for 'Services receives selected' and 'Numbers' for 'in'. Then paste the following into the Run AppleScript action, replacing all text already there by default:
--Transpose - select range, run, paste transposed values where wanted
try
tell application "Numbers" to tell front document to tell active sheet
set selected_table to first table whose class of selection range is range
tell selected_table
set my_selection to the selection range
set first_col to address of first column of my_selection
set last_col to address of last column of my_selection
set first_row to address of first row of my_selection
set last_row to address of last row of my_selection
set str to ""
repeat with i from first_col to last_col
repeat with j from first_row to last_row
set str to str & (value of cell j of column i of selected_table) & tab
end repeat
set str to str & return -- add line return after row
end repeat
end tell
end tell
set the clipboard to str
display notification "Ready to paste transposed values" with title "Numbers"
on error
display dialog "Select a range first and then try again"
end try
--end script
Hit the compile "hammer" and the script should indent properly. Then save the service with the name you want to appear in your menu, and it will thereafter be available via the Services menu (and keyboard shortcut, if you set one up in System Preferences > Keyboard > Shortcuts > Services).
That's it. Less then five minutes' one-time set-up work and you've got a menu pick for a transpose functionality that is as convenient as Excel's.
SG -
Handling Out-of-Range and Overflow
How to deal with Out-of-Range and Overflow?
Suppose I have a SQL table with one column of datatype “tinyint”.
tinyint’s range is 0-255.
Table:
create table xyz
( userid tinyint not null auto_increment,
After inserting 256 rows, we cannot insert another row .
When MySQL stores a value in a numeric column that is outside the permissible range of the column data type, MySQL rejects the out-of-range value with an error, and the insert fails.
How to deal with this situation ?
Obviously we can use some data type with very big range for e.g. bigint .. but still every data type got some maximum limit. So, there must be a way through which we can deal with this situation.It appears that you are referring to MySQL, not Oracle. If you have a MySQL-specific question, you most likely want to post the question in the MySQL forum.
In general, though, what does it mean to you to "handle" the error? The insert throws an exception, your code can catch the exception. It can log the exception. It could, potentially, re-try the insert with a different numeric value that does not cause the failure. Is that what you mean by "handle"?
When you're designing the data model, you need to pick data types whose ranges are large enough to accommodate the data you will ultimately insert. If you want to be able to store values larger than 256, you would need to choose a data type for the column that can handle numbers that large. That means that when you are creating the data model, you need to know, realistically, how many rows each table will have and what the maximum value in any particular column will be. And you need to set the data types appropriately.
Justin -
I have code that has the line "rowNum = objXLAppln.Range("A" & Rows.Count).End(xlUp).Row". Every once in a while the macro crashes on this line. It doesn't happen regularly or with a pattern. The entire code is below. I have several
modules that use this line of code. Any ideas?
Function ImportScores()
Dim RecSet As DAO.Recordset
Dim objXLAppln As Excel.Application
Dim objWBook As Excel.Workbook
Dim rowNum As Variant
Dim i As Integer
Dim j As Integer
Dim StrPathFile As String, strFile As String, strPath As String
Dim strBrowseMsg As String, strInitialDirectory As String, strFilter As String
'show dialogue box
strBrowseMsg = "Select the EXCEL file:"
'set directory to load files from
strInitialDirectory = "C:\Bridge_CIP_Part-A_B\"
'run strFilter function
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xlsx)", "*.xlsx")
StrPathFile = ahtCommonFileOpenSave(InitialDir:=strInitialDirectory, _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:=strBrowseMsg, _
Flags:=ahtOFN_HIDEREADONLY)
If StrPathFile = "" Then
MsgBox "No file was selected.", vbOK, "No Selection"
Exit Function
End If
'Set Excel application object. Critical for macro to run properly. Do not change.
Set objXLAppln = New Excel.Application
'Open workbook and worksheet to load data.
With objXLAppln
Set objWBook = .Workbooks.Open(StrPathFile)
objXLAppln.Visible = True
End With
Set RecSet = CurrentDb.OpenRecordset("Performance_Scores")
'Copy data from Excel cells to Access fields
objXLAppln.Sheets("Performance_Attributes").Select
rowNum = objXLAppln.Range("A" & Rows.Count).End(xlUp).Row
objXLAppln.Range("A10").Select
'Add records to table from Excel
With RecSet
For i = 0 To rowNum - 9
RecSet.AddNew
RecSet.Fields("CIP_ID").value = objXLAppln.ActiveCell.Offset(i, 0).value
RecSet.Fields("5YearScore").value = objXLAppln.ActiveCell.Offset(i, 53).value
RecSet.Fields("10YearScore").value = objXLAppln.ActiveCell.Offset(i, 54).value
RecSet.Fields("15YearScore").value = objXLAppln.ActiveCell.Offset(i, 55).value
RecSet.Fields("20YearScore").value = objXLAppln.ActiveCell.Offset(i, 56).value
RecSet.Update
Next i
End With
'Close everything
RecSet.Close
objWBook.Close SaveChanges:=False
objXLAppln.Quit
Set RecSet = Nothing
Set objWBook = Nothing
Set objXLAppln = Nothing
End FunctionI rewrote as below.
But rather than doing it this way, I would create a linked table to this workbook and import the data using an Append query.
Function ImportScores()
Const FOOTER_ROWS_TO_SKIP As Integer = 10
Const COL_CIP_ID As Integer = 1
Const COL_5YEARSCORE As Integer = 54
Dim RecSet As DAO.Recordset
Dim objXLAppln As Excel.Application
Dim objWBook As Excel.Workbook
Dim objXLSheet As Excel.Worksheet
Dim rowNum As Variant
Dim row As Integer
Dim j As Integer
Dim StrPathFile As String, strFile As String, strPath As String
Dim strBrowseMsg As String, strInitialDirectory As String, strFilter As String
'show dialogue box
strBrowseMsg = "Select the EXCEL file:"
'set directory to load files from
strInitialDirectory = "C:\Bridge_CIP_Part-A_B\"
'run strFilter function
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xlsx)", "*.xlsx")
StrPathFile = ahtCommonFileOpenSave(InitialDir:=strInitialDirectory, _
Filter:=strFilter, OpenFile:=True,
DialogTitle:=strBrowseMsg,
Flags:=ahtOFN_HIDEREADONLY)
'StrPathFile = "C:\Users\Tom\Documents\test.xlsx" 'testonly
If StrPathFile = "" Then
MsgBox "No file was selected.", vbOK, "No Selection"
Exit Function
End If
'Set Excel application object. Critical for macro to run properly. Do not change.
Set objXLAppln = New Excel.Application
'Open workbook and worksheet to load data.
With objXLAppln
Set objWBook = .Workbooks.Open(StrPathFile)
objXLAppln.Visible = True
Set objXLSheet = objXLAppln.Sheets("Performance_Scores")
End With
rowNum = objXLSheet.UsedRange.Rows.Count
'Add records to table from Excel
Set RecSet = CurrentDb.OpenRecordset("Performance_Scores", dbOpenDynaset)
With RecSet
For row = 1 To rowNum - FOOTER_ROWS_TO_SKIP
RecSet.AddNew
RecSet.Fields("CIP_ID").Value = objXLSheet.Cells(row, COL_CIP_ID).Value
RecSet.Fields("5YearScore").Value = objXLSheet.Cells(row, COL_5YEARSCORE).Value
'etc.
RecSet.Update
Next row
End With
'Close everything
RecSet.Close
objWBook.Close SaveChanges:=False
objXLAppln.Quit
Set RecSet = Nothing
Set objWBook = Nothing
Set objXLAppln = Nothing
End Function
-Tom. Microsoft Access MVP -
Hi all,
I'm just filling a Numbers table from a webseite per copy & paste.
Can I swap columns and rows in Numbers like in Quantrix?
AxelHere is a new transpose script.
This one inserts formulas grabbing the contents of the original block so the transposed one reflects the changes which may be done in the original block.
It's a bit long but I post it here because it introduce some handlers allowing us to acess some interesting features.
--[SCRIPT transposeLive]
Enregistrer le script en tant qu'Application ou Progiciel : transposeLive].app
déplacer l'application créée dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Merci à Scott Lindsey & Ed.Stockly du forum [email protected]
qui m'ont aidé à construire le code récupérant le bloc sélectionné.
Sélectionnez le bloc de cellules à transposer
menu Scripts > Numbers > transposeLive (exécute le script une première fois)
Le script récupère les informations utiles sur le bloc à transposer
Sélectionner la première cellule du bloc destination
(elle ne peut être dans le bloc source)
menu Scripts > Numbers > transposeLive (exécute le script une deuxième fois)
Il insère des formules récupérant le contenu du bloc transposé.
Les modifications au contenu du bloc source seront répercutées.
+++++++
Save the script as an Application or an Application Bundle: transposeLive].app
Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Thanks to Scott Lindsey & Ed.Stockly from [email protected]
which helped me to build the code grabbing the selected range.
Select a group of cells.
menu Scripts > Numbers > transposeLive (Run the script once.)
It grabs infos about the selection
select the first cell of the destination
(can't be in the source range)
menu Scripts > Numbers > transposeLive (Run the script one more time.
It will insert formulas grabbing the transposed range.
Changes in the source one will be reflected.
Yvan KOENIG (Vallauris, FRANCE)
19 janvier 2009
property theApp : "Numbers"
property sourceCell : missing value
property sourceTable : missing value
property sourceSheet : missing value
property nbRows : missing value
property nbColumns : missing value
--=====
on run
set firstPass to sourceCell = missing value
if firstPass then (*
Here we are in the first pass.
We grab infos about the source range *)
set {rName, sourceTable, sourceSheet, dName} to my getSelection()
if rName is missing value then error "No selected cells"
set twoNames to my decoupe(rName, ":")
if sourceTable does not start with "'" then set sourceTable to "'" & sourceTable & "'"
if sourceSheet does not start with "'" then set sourceSheet to "'" & sourceSheet & "'"
set sourceCell to item 1 of twoNames
set {colNum1, rowNum1} to my decipher(item 1 of twoNames)
if item 2 of twoNames = item 1 of twoNames then
set {colNum2, rowNum2} to {colNum1, rowNum1}
else
set {colNum2, rowNum2} to my decipher(item 2 of twoNames)
end if
set nbRows to rowNum2 + 1 - rowNum1
set nbColumns to colNum2 + 1 - colNum1
else --**************
Here we are in the second pass
We insert formulas grabbing the transposed cells *)
set deci to character 2 of (0.5 as text)
if deci is "." then
set delim to ","
else
set delim to ";"
end if
set p2lproj to my getLproj(theApp)
set OFFSET_loc to my getLocalizedFuncName(p2lproj, "OFFSET")
--set ADDRESS_loc to my getLocalizedFuncName(p2lproj, "ADDRESS")
--set INDIRECT_loc to my getLocalizedFuncName(p2lproj, "INDIRECT")
set {rName, tName, sName, dName} to my getSelection()
if rName is missing value then error "No selected cells"
set twoNames to my decoupe(rName, ":")
set {colNum1, rowNum1} to my decipher(item 1 of twoNames)
if item 2 of twoNames = item 1 of twoNames then
set {colNum2, rowNum2} to {colNum1, rowNum1}
else
set {colNum2, rowNum2} to my decipher(item 2 of twoNames)
end if
(* Here we know the starting point of the destination area. *)
tell application theApp
activate
tell document dName to tell sheet sName to tell table tName
set rowsCible to (get row count)
set rowsNeeded to rowsCible - 1 + nbColumns
if rowsNeeded > rowsCible then
repeat (rowsNeeded - rowsCible) times
add row below row rowsCible
end repeat
end if -- rowsNeeded
set columnsCible to (get column count)
set columnsNeeded to columnsCible - 1 + nbRows
if columnsNeeded > columnsCible then
repeat (columnsNeeded - columnsCible) times
add column after column columnsCible
end repeat
end if -- columnsNeeded
repeat with i from 1 to nbRows
repeat with j from 1 to nbColumns
set value of cell (colNum1 - 1 + i) of row (rowNum1 - 1 + j) to "=" & OFFSET_loc & "(" & sourceSheet & " :: " & sourceTable & " :: " & sourceCell & delim & i - 1 & delim & j - 1 & ")"
end repeat
end repeat
end tell -- table of sheet of document
end tell -- Application
set sourceCell to missing value
set sourceTable to missing value
set sourceSheet to missing value
set nbRows to missing value
set nbColumns to missing value
end if
end run
--=====
on getSelection()
local mySelectedRanges, sheetRanges, thisRange, _, myRange, myTable, mySheet, myDoc, mySelection
tell application theApp
activate
tell document 1
set mySelectedRanges to selection range of every table of every sheet whose it is not missing value
repeat with sheetRanges in mySelectedRanges
try
count of sheetRanges
on error
set sheetRanges to {sheetRanges}
end try
repeat with thisRange in sheetRanges
if contents of thisRange is not missing value then
try
--return thisRange --poorly formed result
thisRange as text
on error errMsg number errNum
set {_, myRange, _, myTable, _, mySheet, _, myDoc} to my decoupe(errMsg, quote)
--set mySelection to (a reference to (range rn of table tn of sheet sn))
return {myRange, myTable, mySheet, myDoc}
end try
end if -- contents…
end repeat -- thisRange
end repeat -- sheetRanges
end tell -- document 1
end tell -- application
return {missing value, missing value, missing value, missing value}
end getSelection
--=====
on decipher(n)
local letters, colNum, rowNum
set letters to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if (character 2 of n) as text > "9" then
set colNum to (offset of (character 1 of n) in letters) * 64 + (offset of (character 2 of n) in letters)
set rowNum to (text 3 thru -1 of n) as integer
else
set colNum to offset of (character 1 of n) in letters
set rowNum to (text 2 thru -1 of n) as integer
end if
return {colNum, rowNum}
end decipher
--=====
on decoupe(t, d)
local l
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to ""
return l
end decoupe
--=====
on getLproj(a)
local lprojs, localId, lproj
set lprojs to {{"da_DK", "da.lproj"}, {"nl_NL", "Dutch.lproj"}, {"en_US", "English.lproj"}, {"fi_FI", "fi.lproj"}, {"fr_FR", "French.lproj"}, {"de_DE", "German.lproj"}, {"it_IT", "Italian.lproj"}, {"ja_JP", "Japanese.lproj"}, {"ko_KR", "ko.lproj"}, {"no_NO", "no.lproj"}, {"pl_PL", "pl.lproj"}, {"pt_BR", "pt.lproj"}, {"pt_PT", "pt_PT.lproj"}, {"ru_RU", "ru.lproj"}, {"es_ES", "Spanish.lproj"}, {"sv_SE", "sv.lproj"}, {"zf_CN", "zh_CN.lproj"}, {"zh_TW", "zh_TW.lproj"}}
set localId to my getLocale(a, "http://support.apple.com/en_US/manuals/#iwork")
set localId to text (1 + (count of "http://support.apple.com/")) thru -1 of localId
set localId to text 1 thru ((offset of "/" in localId) - 1) of localId
set lproj to ""
repeat with i from 1 to count of lprojs
if localId is item 1 of item i of lprojs then
set lproj to item 2 of item i of lprojs
exit repeat
end if
end repeat
if lproj = "" then error "A Frameworks file is missing !"
return (path to application support as text) & "iWork '09:Frameworks:SFTabular.framework:Versions:A:Resources:" & lproj
end getLproj
--=====
on getLocale(a, x)
tell application a to return localized string x
end getLocale
--=====
on getLocalizedFuncName(f, x)
return localized string x from table "Localizable" in bundle file f
end getLocalizedFuncName
--=====
--[/SCRIPT]
Yvan KOENIG (from FRANCE lundi 19 janvier 2009 18:57:48) -
Can anyone suggest me an efficent SQL which can return range of rows for example I want to display records with rownum>=20 and rownum<=40.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Uma Santharam:
Can anyone suggest me an efficent SQL which can return range of rows for example I want to display records with rownum>=20 and rownum<=40. <HR></BLOCKQUOTE>
Hi,
You can not use equal to and greater then condition in rownum.
Secondly if you want 20 and 40 to be included in range search then use rownum <21
and rownum < 41.
Try to use following query to solve your above said problem.
select e1.empno from emp e1
where rownum <10 and empno not in
( select e1.empno from emp e1 where rownum <5);
null -
Select Date between range and display
Hello - i need some ideas to the following:
I need to create a form to submit some information, with the
date that form was submitted, to a database using php.
Once the form is submitted i need to retrieve multiple rows
from the database based on a selected date range, and display the
information
Question one - any ideas on the flow that i need
question two - how do you think that i best record the date -
given that i need to select a range later.
question three - how do I select mutiple rows give a range of
dates
ThanksHello - i need some ideas to the following:
I need to create a form to submit some information, with the
date that form was submitted, to a database using php.
Once the form is submitted i need to retrieve multiple rows
from the database based on a selected date range, and display the
information
Question one - any ideas on the flow that i need
question two - how do you think that i best record the date -
given that i need to select a range later.
question three - how do I select mutiple rows give a range of
dates
Thanks -
Dynamic Ranges and Dynamic SQL
Hi,
I have built a table of ranges and would like to use them in an sql query. Ive had a look but cannot think of a way to get this to work.
I have a table of fieldnames and a table of ranges. Does abap have a way of selecting a element from a table so I can generate the following sql.
select * from table
into some_table
where
'FIELD0' IN range[0] AND
'FIELD1' IN range[1] AND
'FIELD2' IN range[2] AND
'FIELD3' IN range[3] AND
I know how to build dynamic sql thats the easy bit. The hard bit is inserting a reference to a table element dynamically into the sql :S
Any help would be much appretiated,
Thanks,
Jameshi,
Yes, We can make use of Subroutine pools.
This is from F1 help about dynamic where..
1. This variant is exclusively for use with SELECT. The
internal table itab can only have one field which must be of
type C and not be greater than 72 characters. itab must be
specified in parentheses with no blanks between the
parentheses and the table name. The condition specified in
the internal table itab must have the same form as a
condition in the ABAP/4 source code. The following
restrictions apply:
- You can only use literals as values, not variables.
<b> - The operator IN cannot be used in the form f1 IN itab1. </b>
Regards,
Sailaja. -
Interactive Report Column Headings and Row Height
I am using the div style="width:350px;" method to control the width of columns in various interactive reports. That works fine except for the following:
1. When creating filters, the <div...> stuff shows up along with the actual column heading, thus confusing some end users
2. Even when I uncheck the "Use same text for single row view" checkbox and then provide a simple single row view label, the <div> stuff still shows up on the single row view
Does anyone have a better solution?
Also, does anyone know of a way to limit the row height within an interactive report row? I have some columns of data that contain a large amount of HTML data and I'd like to be able to limit the number of rows that show on the report.
Is Oracle planning to provide some better control over the Interactive Report columns in another version? The Interactive Report is such a huge improvement in usability in APEX - it would be great to take it to another level by providing some better control over column width and row height.
Edited by: DaleB on Jun 18, 2009 8:54 AM
Edited by: DaleB on Jun 18, 2009 8:54 AMDale,
Unfortunately we don't have much we can use to do what you would like. I would have said it's impossible until version 4 but you could actually do something similar to what Roel has done. His trick is in the edit button. He changed the edit button to use an "onload" call to a JavaScript process. You could do the same but call a process that goes across the rows and styles each column. Now because you don't have a way to identify the column (can't use the order because the end user could change it) you'll have to write the code to look at the top row first and then style the appropriate column. As far as I can tell, this would be quite difficult and inefficient. Having said that if you need it that bad and would like some help with it, put up an example application on apex.oracle.com and provide the workspace/username/password and I'll take a look.
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen
You can reward this reply by marking it as either Helpful or Correct ;-) -
Also, I have a timer that lets me know how long the trigger has been active. I want to know if it is possible if that time would be reset everytime the trigger goes off.
Attachments:
Code.vi 113 KB1. Do not run using the Continuous Run button! This is intended only for certain types of trouble shooting and not for normal operation.
2. Put a while loop around your entire program. Add a stop button wired to the stop terminal of the loop.
3. Then you can replace all the feedback nodes with one shift register with the input expanded to five elements. Sum the three bottom ones for your averaging.
4. Nothing is wrong with the In Range and Coerce. You should only check it when you have data. That is what the Data Available output from Trigger and Gate is for.
5. I am not sure what you want to reset for your timer or exactly when, but it should be possible.
6. I did not try to figure it all out but you may not need the timer while loop once you wrap the loop suggested in 2 around the rest of the code. You may be able to move the shift registers to the outer loop.
Lynn -
How to enter a data into the specified column and row in a created table
Hi,
I want to enter some data to specified column and row in a already created table. Please let me know how to do this.
Regards
Shivakumar SinghA table is just a 2D array of strings. Keep it in a shift register and use "replace array element" to modify the desired entry programmatically.
If you want to modify it manually and directly from the front panel, make it into a control and type directly into the desired element. (In this case your program would need to write to it using a local variable).
Atttached is a simple example in LabVIEW 7.0 that shows both possibilities.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
ChangeTableEntries.vi 41 KB -
How to get the current selected column and row
Hi,
A difficult one, how do i know which column (and row would also be nice) of a JTable is selected?
e.g.
I have a JButton which is called "Edit" when i select a cell in the JTable and click the button "Edit" a new window must be visible as a form where the user can edit the a part of a row.
Then the column which was selected in the JTable must be given (so i need to know current column) and then i want the TextField (the one needed to be edited) be active with requestFocus(). So it would be
pricetextfield.requestFocus();
Problem now is that i have to click every time in the window the JTextField which was selected in the JTable. I have chosen for this way of editing because my application is multi-user and it would be too difficult for me when everybody did editing directly (catch signals, reload data, etc.).
My question is how do I know the current column and the current row in a JTable?I'm not sure what your mean by the "current" row or column, but the following utility methods return
which row and column have focus within the JTable.
public static int getFocusRow(JTable table) {
return table.getSelectionModel().getLeadSelectionIndex();
public static int getFocusColumn(JTable table) {
return table.getColumnModel().getSelectionModel().getLeadSelectionIndex();
}
Maybe you are looking for
-
Remote access to Time Capsule won't work
Over the past couple of months I've been doing lots of research and planning into replacing my Mac Pro and old MacBook Pro with a new Mac setup. I was looking for efficiency, productivity and ultimate portability so the Macbook Pro Retina and Time C
-
A link visible in IE but not in FireFox
A link "Intimation/Hall ticket for October 2011 Exam" at www.nios.ac.in is not visible in FireFox. Whereas same link is visible in Internet Explorer. Tried the option of clearing cache also.
-
How can I find out who has had unauthorised access to my iCloud account
I have received an email to say that someone has accessed my iCloud account. How can I find out details of who has done this ?
-
Awful broadband speed, line noise + disconnecting ...
We're experiencing very slow internet speed, as well as noise on our phone line, to the point where we can hear voices in addition to static etc. Our BB speed fluctuated from a decent IP Profile to a bad one (<500kb) and I can only assume that the no
-
I have just come back to Apache 1 from 2. But the graphs aren't working. I have to Combined. %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" Anything alse need doing?