Alphabetize column starting from a specific row
I'm creating a document where i have a header and under the header i have names and numbers. In one row I have a title for "Names" (C1) in the next column, within the same row, "Phone Numbers. " (C2). My question is; how can I arrange a column in alphabetical order starting from a specific row and not the whole table. Thanks in advance.
PeterBreis0807 wrote:
Select the cells in the row or column that you want to sort:
Inspector > Table > Table > Edit Rows & Columns > Sort Ascending/Descending
It will only do the cells you have selected and leave the rest as is.
Peter
Within the Table Inspector are two buttons at the top, Table and Format.
Peter
Similar Messages
-
How to start from a specific point on the timeline
I have a horizontal list of image thumbnails, there are 21 thumbnails and only 7 are visible at one time and scrolls back and forth. It works fine.
However, when I choose an image that is not in the first seven, say the 8th image, the page loads and the thumbnails goes back to the beginning images (undesirable). When the 8th image page is shown I would like the thumbnails to start at the eigth image, NOT from the beginning again.
I had the animation positioned to the eight image for the start, with the first 7 off to the left and the second 7 off to the right. But when I saved and loaded it into the page, it just starts from the begining.
How can I start the thumbnails from a specific desired position, such as the 8th image or the 15th image depending on the page?
Thank you for any help.
AnthonyHi Anthony,
Thank you for your post.
It would be better if you share any link or actual composition with us.
Regards,
Devendra -
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 -
Average salary for 12 months start from a specific date
Hi Expert,
If we want to calculate the average for past 12 past month, starting from a past date, any idea how to achieve this?
E.g. I would like to have the average for past 12 months, starting from 01.Nov 2014, i.e. the required periods are Nov 2013 to Oct 2014
ThanksGo through below link you may get an idea.
Payroll processing - Calculate average 6 month Basic Salary
Regards
Venkatesh -
Getting values from a specific row in a table
hi all, i have a table that has the following data
WITH sec AS
SELECT 111 id, 'XPE' cid, 10 alias, 'TLC' Description, 'PEYU' lvl_1, 'IES' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 111 id, 'XPE' cid, 78 alias, 'TLC2' Description, 'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 111 id, 'XPE' cid, 200 alias, 'TLC' Description, null lvl_1, null lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 111 id, 'XPE' cid, 54 alias, 'TLC3' Description, 'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 'XPE2' cid, 10 alias, 'PAD' Description, 'PEYU' lvl_1, 'IES' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 112 id, 'XPE2' cid, 78 alias, 'PAD2' Description, 'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 'XPE2' cid, 54 alias, 'TLC3' Description, 'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 'XPE2' cid, 200 alias, 'PAD' Description, 'SIN' lvl_1, 'CON' lvl_2, ' UIE' lvl_3 FROM dual UNION ALL
SELECT 113 id, 'XPE3' cid, 10 alias, 'PAD5' Description, NULL lvl_1, NULL lvl_2, NULL lvl_3 FROM dual UNION ALL
SELECT 113 id, 'XPE3' cid, 200 alias, 'PAD5' Description, NULL lvl_1, NULL lvl_2, NULL lvl_3 FROM dual UNION ALL
SELECT 113 id, 'XPE3' cid, 78 alias, 'PAD7' Description, 'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 113 id, 'XPE3' cid, 54 alias, 'TLE' Description, 'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual
)i want to write a query that give me this output
ID CID ALIAS DESCRIPTION LVL_1 LVL_2 LVL_3
111 XPE 10 TLC PEYU IES BAN
111 XPE 200 TLC PEYU IES BAN
111 XPE 78 TLC2 SUN BAN3
111 XPE 54 TLC3 SUN5 BAN3
112 XPE2 10 PAD PEYU IES BAN
112 XPE2 200 PAD SIN CON UIE
112 XPE2 78 PAD2 SUN BAN3
112 XPE2 54 TLC3 SUN5 BAN3
113 XPE3 10 PAD5
113 XPE3 200 PAD5
113 XPE3 78 PAD7 SUN BAN3
113 XPE3 54 TLE SUN5 BAN3
this is how the logic works:
as you can see the table has many different set of ids, 111,112,113 and each id has a set of alias
for id 111 and alias 200 the sec table has null values for level 1 and level 2 columns. what i want to do
is that if any of the level1,level2 and level3 columns has null VALUES(FOR aliases=200) then the values should be taking from the ROW(s) with alias=10
in this case alias=200 display peyu and ies for level1 and level2 column. this values were taking from the row with alias=10 and id =111.
level3 stay the same since it is not null
for id 112 and alias =200, none of te level columns has null so the value stay the same as in the table
for id 113 alias 200, all level columns has null so the value should be taking from alias=10 id =113.
in this case the row with alias=10 has also null so both rows 200 and 10 gets display with null values
the other rows with different alias should just be display.
i tried using las_value analytic function but i was not successful. i am using ORACLE 9I and ignore null option in last_value function is not supported
the data in the table is not in any particular order.
can someone help write a query that gives me the output above. thanksIf I understand correct,below solution is corect. :-)
col lvl_2 for a10
WITH sec AS(
SELECT 111 id, 10 alias,'PEYU' lvl_1, 'IES' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 111 id, 78 alias,'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 111 id,200 alias,null lvl_1, null lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 111 id, 54 alias,'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 10 alias,'PEYU' lvl_1, 'IES' lvl_2, ' BAN' lvl_3 FROM dual UNION ALL
SELECT 112 id, 78 alias,'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id, 54 alias,'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 112 id,200 alias,'SIN' lvl_1, 'CON' lvl_2, ' UIE' lvl_3 FROM dual UNION ALL
SELECT 113 id, 10 alias, NULL lvl_1, NULL lvl_2, NULL lvl_3 FROM dual UNION ALL
SELECT 113 id,200 alias, NULL lvl_1, NULL lvl_2, NULL lvl_3 FROM dual UNION ALL
SELECT 113 id, 78 alias,'SUN' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual UNION ALL
SELECT 113 id, 54 alias,'SUN5' lvl_1, null lvl_2, ' BAN3' lvl_3 FROM dual
select id,alias,
case when alias = 200 and lvl_1 is null
then max(decode(alias,10,lvl_1)) over(partition by id)
else lvl_1 end as lvl_1,
case when alias = 200 and lvl_2 is null
then max(decode(alias,10,lvl_2)) over(partition by id)
else lvl_2 end as lvl_2,
case when alias = 200 and lvl_3 is null
then max(decode(alias,10,lvl_3)) over(partition by id)
else lvl_3 end as lvl_3
from sec
order by id,alias;
ID ALIAS LVL_ LVL_2 LVL_3
111 10 PEYU IES BAN
111 54 SUN5 null BAN3
111 78 SUN null BAN3
111 200 PEYU IES BAN
112 10 PEYU IES BAN
112 54 SUN5 null BAN3
112 78 SUN null BAN3
112 200 SIN CON UIE
113 10 null null null
113 54 SUN5 null BAN3
113 78 SUN null BAN3
113 200 null null null -
Custom row-fetch and how to get column values from specific row of report
Hi -- I have a case where a table's primary key has more than 3 columns. My report on the
table has links that send the user to a single-row DML form, but of course the automatic
fetch won't work because 1) I can't set more than 3 item values in the link and 2) the
auto fetch only handles 2 PK columns.
1)
I have written a custom fetch (not sure it's the most elegant, see second question) that is working
for 3 or few PK columns (it references the 1-3 item values set in the link), but when there are
more than 3, I don't know how to get the remaining PK column values for the specific row that was
selected in the report. How can I access that row's report column values? I'll be doing it from the
form page, not the report page. (I think... unless you have another suggestion.)
2)
My custom fetch... I just worked something out on my own, having no idea how this is typically
done. For each dependent item (database column) in the form, I have a source of PL/SQL
function that queries the table for the column in question, using the primary key values. It works
beautifully, though is just a touch slow on my prototype table, which has 21 columns. Is there
a way to manually construct the fetch statement once for the whole form, and have APEX be smart
about what items get what
return values, so that I don't have to write PL/SQL for every item? Because my query data sources
are sometimes in remote databases, I have to write manual fetch and dml anyway. Just would like
to streamline the process.
Thanks,
CarolHI Andy -- Well, I'd love it if this worked, but I'm unsure how to implement it.
It seems I can't put this process in the results page (the page w/ the link, that has multiple report rows), because the link for the row will completely bypass any after-submit processes, won't it? I've tried this in other conditions; I thought the link went directly to the linked-to page.
And, from the test of your suggestion that I've tried, it's not working in the form that allows a single row edit. I tried putting this manually-created fetch into a before header process, and it seems to do nothing (even with a hard-coded PK value, just to test it out). In addition, I'm not sure how, from this page, the process could identify the correct PK values from the report page, unless it can know something about the row that was selected by clicking on the link. It could work if all the PK columns in my edit form could be set by the report link, but sometimes I have up to 5 pk columns.
Maybe part of the problem is something to do with the source type I have for each of the form items. With my first manual fetch process, they were all pl/sql functions. Not sure what would be appropriate if I can somehow do this with a single (page level?) process.
Maybe I'm making this too hard?
Thanks,
Carol -
SSRS 2012
Dataset (40 columns) including the first 3 rows for Report layout configuration (eg: the <second> row specifies the column background color).
Starting from the 4th row, the dataset contains data to be displayed.
I would like to change the background color of the ColumnHeader/Column based on the value in the same column in the <second> row.
How can I accomplish the this requirement? (this must be applied for all the columns)
ThanksHi Fasttrck2,
Per my understanding that you want to specify the background color of all the columns/column header based on the value in one special column of the special row, right?
I have tested on my local environment and you can add expression to condition show the background color in the columns properties or the column header properties.
Details information below for your reference:
Specify the background color in the Column header: you can select the entire column header row and in the properties add expression in the Background color :
If you want to specify the background color for the entire column, you can select the entire column and add the expression, repeat to add background color for other columns.
If you want to specify the background color based on the value in the specific columns and row, you can create an hidden parameter to get the list of values from the specific column, specify the Available values and default values by select "Get
values from a query", finally using the expression as below to get the specific value you want:
Expression(Backgroud Color):
=IIF(Parameters!Para.Value(1)="1221","red","yellow")
If your problem still exists, please try to provide some smaple data of the report and also the snapshot of the report structure to help us more effective to provide an solution.
Any problem, please feel free to ask.
Regards
Vicky Liu
If you have any feedback on our support, please click
here.
Vicky Liu
TechNet Community Support -
Remove specific row and column from 2d array
Hi,
I would like to know how to remove the specific row and column from 2d array.
for example, I have the original 4x4 array as below
2 -1 -1 0
-1 2 0 -1
-1 -1 2 0
-1 -1 -1 3
let say that i want to remove row 2(bold) and column 2(bold), and the new 2d array should get as below
2 -1 0
-1 2 -1
-1 -1 3
Thanks.You can't remove elements of an array, it's fixed at a certain size once created. What you can do however is make a new array and only copy the things you want. Something like:public static void main(String[] args) {
Integer[][] bar = new Integer[5][5];
for (int i = 0; i < bar.length; i++) {
Integer[] baz = bar;
Arrays.fill(baz, i);
System.out.println(Arrays.toString(baz));
Integer[][] muu = new Integer[5][4];
removeColumn(3, bar, muu);
for (Integer[] mee : muu) {
System.out.println(Arrays.toString(mee));
Integer[][] smuu = new Integer[4][5];
removeRow(3, bar, smuu);
for (Integer[] mee : smuu) {
System.out.println(Arrays.toString(mee));
public static <T> void removeRow(int row, T[][] a, T[][] result) {
if (row >= a.length) {
throw new IllegalArgumentException("no row at " + row);
for (int a_r = 0, result_r = 0; a_r < a.length; a_r++) {
if (a_r == row) {
continue;
System.arraycopy(a[a_r], 0, result[result_r], 0, a[a_r].length);
result_r++;
public static <T> void removeColumn(int col, T[][] a, T[][] result) {
for (int i = 0; i < a.length; i++) {
if (col >= a[i].length) {
throw new IllegalArgumentException("no column at [" + i + ", " + col + "]");
for (int a_i = 0, r_i = 0; a_i < a[i].length; a_i++) {
if (a_i == col) {
continue;
result[i][r_i] = a[i][a_i];
r_i++; -
How do I read text from specific rows and columns in a tree structure?
How do I read text from specific rows and columns in a tree structure? In a table you can specify the cell to read from but I have not been able to figure out how to do this with a tree structure.
You need to set two properties to activate the correct cell and then you can read it's string property.
The positioning properties are the "ActiveItemTag" and
"ActiveColNum" properties. With them you select the tree item by it's tag and the active column. The string can then be read from the "Cell String" property.
MTO -
Hi,
Being an experienced Excel user before Power BI, I am just starting to explore the M and Power Query capabilities, and need help already (ain't easy to google this use case somehow):
I need to import the table which sits in the Excel file with header row in the row 17 of Excel sheet, with some metadata header in the preceding rows of the columns A and B.
01: Report name, Quick Report
02: Report Date, 1/1/2014
17: Employee Name, Manager, etc...
18: John Doe, Matt Beaver, etc.
Both (a) direct attempt to load as Excel file and (b) the indirect way through [From Folder] and formula in custom column -- both lead to the same error: "[DataFormat.Error] External table is not in the expected format."
Specifically, I tried to use the [Power Query -> From File -> From Folder] functionality, select an Excel file and add a custom column to access the binary content: [Add Custom Column] with formula "=Excel.Workbook([Content])".
It looks like Power Query expects a rectangular range with headers full-width followed by a contiguous table range to import anything, and refuses to load if that is not the case...
QUESTION: Is there any way to load whatever-formatted data from Excel first, and then manipulate the overall imported range (like referring to rows starting from 17th using "Table.SelectRows" etc.) to read the actual data? Reading and using
the metadata from header would be a bonus, but that comes second... The main issue is to get something from a non-regular Excel file to later work with using M formulae ...
Thanks!
SAMFinally found the answer to this one in ():
You Cannot Open a Password-Protected Workbook
If the Excel workbook is protected by a password, you
cannot open it for data access, even by supplying the correct password with
your connection settings, unless the workbook file is already open in the
Microsoft Excel application. If you try, you receive the following error
message:
Could not decrypt file.
ANSWER: So, will have either weave in the work with temporary unprotected files or requires opening them before updating the data source (although this almost defeats the purpose of automation...)
ANSWER to ORIGINAL QUESTION: password was preventing Power Query from reading the Excel file. For solution see above.
Thanks anyway for participation and inspiration, Imke! -
How To Concatenate Column Values from Multiple Rows into a Single Column?
How do I create a SQL query that will concatenate column values from multiple rows into a single column?
Last First Code
Lesand Danny 1
Lesand Danny 2
Lesand Danny 3
Benedi Eric 7
Benedi Eric 14
Result should look like:
Last First Codes
Lesand Danny 1,2,3
Benedi Eric 7,14
Thanks,
David JohnsonStarting with Oracle 9i
select last, first, substr(max(sys_connect_by_path(code,',')),2) codes
from
(select last, first, code, row_number() over(partition by last, first order by code) rn
from a)
connect by last = prior last and first = prior first and prior rn = rn -1
start with rn = 1
group by last, first
LAST FIRST CODES
Lesand Danny 1,2,3
Benedi Eric 7,14Regards
Dmytro -
How to use identity column in table which value always start from one?
Hi all,
Hope doing well,
sir i created one table which has id with number datatype
for which i created sequence and stored procedure so suppose
i inserted two row there it's inserting and id is showing 1, 2
again i truncate that table and again i inserted value there now the id is starting from 3 , 4
so my question is that after truncating table can't it insert from 1 in id column?
thanks,>
sir i created one table which has id with number datatype
for which i created sequence and stored procedure so suppose
i inserted two row there it's inserting and id is showing 1, 2
again i truncate that table and again i inserted value there now the id is starting from 3 , 4
so my question is that after truncating table can't it insert from 1 in id column?
>
Oracle does not have 'identity' columns.
Oracle sequences are NOT gap free.
Oracle sequences are independent objects and not associated with any other table or object.
If you are wanting a gap-free sequnece of numbers, which is not recommended, you will have to create your own functionality. And that functionality will not be scalable or perform well. -
SQL Developer - Pulling column value from previous row
I am using Oracle SQL developer and trying to pull a value from a column from the previous row.
Currently this is an example from the code im using.
Select CD1.nbr_dw, CD1.SEQ_DW, CD1.CDL_NET_PAID, CD1.UNITS_ALLOW,CD1.ALLOW_AMT, CD1.UNIT_PRICE, CD1.BACKED_OUT,
case
When CD1.NET_PAID = 0 then 0
****NEW CODE*****
Else CD1.ALLOW_AMT / CD1.UNIT_PRICE
end as NEW_UNITS
From Table_A CD1
join (Select nbr_dw, DET_DW, SEQ_DW
From Table_B
) CD2
on CD1.nbr_dw = CD2.nbr_dw
I need to add another when statement that says when CD1.BACKED_OUT = 'Y' populated the NEW_UNITS field with the previous rows value of CD1.UNIT_PRICE. Note, the CD1.SEQ_DW can be used to determine the previous row. Any ideas?Hi,
Welcome to the forum!
The analytic LAG function can return a value from the previous row:
LAG (cd1.unit_price) OVER ( -- PARTITION BY x -- if needed
ORDER BY cd1.seq_dw
)It's unclear if you need a PARTITION BY clause or not.
"PARTITION BY x" means that you want the value from the last row that has the same value of x as the current row.
If you omit the PARTITION BY clause, it means you want the last row regardless of what any other columns are.
Whenever you have a problem, it ehlps if you post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
Explain how you get those results from that data.
Always say what version of Oracle you're using. -
Choose Plot Columns as Series or Plot Rows as Series from the pop-up menu in the bottom ba
I am trying to construct a 2D graph in Numbers 3.5 (2109) that shows at two time points the voting intentions by political party. The instruction given by Help is below, but I cannot find the bottom bar or the pop-up box.
Switch rows and columns as data series
When you add a chart, Numbers defines default data series for it. In most cases, if a table is square or if it’s wider than it is tall, the table rows are the default series. Otherwise, the columns are the default series. You can change whether rows or columns are the data series.
Select the chart.
Choose Plot Columns as Series or Plot Rows as Series from the pop-up menu in the bottom bar.
Bar showing options to plot rows or columns as series
Click Done.Hi Phil,
Click once on the chart (graph) to select it. Then click on Edit Data References. The pop-up appears bottom left of the Numbers window.
Regards,
Ian. -
Scrolling with mouse wheel in column browser starts from the start of the list
Hi, I'm wondering if anyone else has been encountering this problem with iTunes.
Ever since updating to 10.5, whenever I use the mouse wheel to scroll in the column browser, it starts from the start of the list, regardless of which artist or album is highlighted.
For instance, I press the M key to jump to artists starting with M, then use the mouse wheel to scroll down the list, in iTunes 10.5 it jumps me back to the As.
The strange thing is that if I then use the mouse wheel to scroll down to the Cs, then jump down the list via a key press, mouse wheel scrolling will start me back to where I last scrolled (C).
How can I fix this problem?
I'm using iTunes 10.5.0.142 on Windows 7 Home Premium.I can confirm the behaviour. It would seem iTunes is keeping a separate record of the position in the list for use by the scroll wheel, and then snapping to that before scrolling up or down a screenful. The same random jumps happen if you use the keyboard Page Up/Page Down commands and then use the mouse wheel.
I shall file a bug report.
tt2
Maybe you are looking for
-
Delivery from Sale Order for Inquiry stock
Dear All, We have unique requirement from client mentioned below, any help would be greatly appreciated. This is a trading sale which is initiated from inquiry. 1. Inquiry is created in SD, which in turn triggers Purchase Requisition. 2. PR is conver
-
File upload with the SOAP Axis Framework
Hi, my scenario is as follows: ERP --> PI --> System A (3rd party application) ERP sends data (IDoc) to the PI and is mapped there to a xml structure expected by A. IDoc --> PI --> target xml structure On A runs a Web service (Axis Framework) with a
-
Trouble using a website.
I am have trouble using a forum over at richdad.com I am only able to see the first page of a topic and can't navigate to the next page. I checked if this was a problem with the site or if it was just my computer. Using a windows computer I was able
-
My themes have stopped working! I've only just started changing them round - When I activiate a theme, my wallpaper changes as it should. But, the background of my menu (when i press the blackberry button) is always the wallpaper of my previous theme
-
Updating license data not possible [Maintenance Package]
Hi, I want to activate Automatic Maintenance Certificate Renewal via solution manager system as per SNOTE: 1280660. SOL MAN: ST400 SP 18 SCM : ST-PI 2008_1_700 SP 01 when i run Maintenance package in my managed (satellite) system i got the log as bel