Changing column names in a local query
I have several underlying queries in my IR bqy(11.1.2.1). I need to be able to change column names in my final query(as the requirements keep changing constantly). Is there a way to do this without modifying the names in the original query(I don't want to create a bunch of computed items either).
Thanks.
I have several underlying queries in my IR bqy(11.1.2.1). I need to be able to change column names in my final query(as the requirements keep changing constantly). Is there a way to do this without modifying the names in the original query(I don't want to create a bunch of computed items either).
Thanks.
Similar Messages
-
Performancepoint Hierarchy Disable Drill Down Level on changing Column name in MDX query
Hello All,
I have created a report in Performance Point dashboard designer but when I change Column name (Measure Name) in MDX query this causes all the built-in ad hoc
navigation and decomposition tree functionality that PP provides to become disabled. Is there any solution or alternative way to achieve this. Please provide solution for this.
Thanks in advance.
Sapna Kshirsagartry these links as reference/:
https://support.office.com/en-nz/article/Getting-acquainted-with-PerformancePoint-Dashboard-Designer-9e014283-afec-4819-87b9-78be6f6ef0d0?ui=en-US&rs=en-NZ&ad=NZ
https://technet.microsoft.com/en-us/library/ee748644%28v=office.15%29.aspx
https://support.office.com/en-gb/article/Creating-scorecards-by-using-PerformancePoint-Dashboard-Designer-2faa3bd6-c361-4c26-a7f9-b81227c875d8
https://msdn.microsoft.com/en-us/library/office/ee557851%28v=office.15%29.aspx
Please mark answer as correct if it is correct else vote for it if you find it useful Happy SharePointing -
how to resolve unresolved column error when we change column name in BMM Layer and removed alias in presentation layer
Looks like the presentation column got Alias before your BMM changes, so in your case renaming logical column and deleting alias is not good to go.
Keep Alias -
Setting Column Names in Dynamic Pivot Query
Hi all,
I'm having trouble setting column names in a dynamic pivot query and was wondering if someone could please help me figure out what I need to do.
To help you help me, I've setup an example scenario in my hosted account. Here's the login info for my hosted site at [http://apex.oracle.com]
Workspace: MYHOSTACCT
Username : DEVUSER1
Password : MYDEVACCTAnd, here is my test application info:
ID : 42804
Name : dynamic query test
Page : 1
Table 1: PROJECT_LIST (Alias = PL... Listing of Projects)
Table 2: FISCAL_YEAR (Alias = FY... Lookup table for Fiscal Years)
Table 3: PROJECT_FY (Alias = PF... Intersection table containing project fiscal years)
Table 4: PROJECT_FY_HEADCOUNT (Alias = PFH... Intersection table containing headcount per project and fiscal year)Please forgive the excessive normalization for this example, as I wanted to keep the table structure similar to my real application, which has much more going on.
In my sample, I have the "Select Criteria" region, where the user specifies the project and fiscal year range that he or she would like to report. Click the Search button, and the report returns the project headcount in a pivoted fashion for the fiscal year range specified.
I've got it working using a hard-coded query, which is displayed in the "Hardcoded Query" region. In this query, I basically return all years, and set conditions on each column which determines whether that column should be displayed or not based on the range selected by the user. While this works, it is not ideal, as there could be many more fiscal years to account for, and this is not very dynamic at all. Anytime a fiscal year is added to the FISCAL_YEAR table, I'd have to update this page.
So, after reading all of the OTN SQL pivot forums and "Ask Tom" pivot thread, I've been able to create a second region labeled "Dynamic Query" in which I've created a dynamic query to return the same results. This is a much more savvy solution and works great; however, the column names are generic in the report.
I had to set the query to parse at runtime since the column selection list is dynamic, which violates SQL rules. Can anyone please help me figure out how I can specify my column names in the dynamic query region to get the same column values I'm getting in the hardcoded region?
Please let me know if you need anymore information, and many thanks in advance!
MarkHi Tony,
Thanks so much for your response. I've had to study up on the dbms_sql package to understand your function... first time I've used it. I've fed my dynamic query to your function and see that it returns a colon delimited list of the column names; however, I think I need a little more schooling on how and where exactly to apply the function to actually set the column names in APEX.
From my test app, here is the code for my dynamic query. I've got it in a "PL/SQL function body returning sql query" region:
DECLARE
v_query VARCHAR2(4000);
v_as VARCHAR2(4);
v_range_from NUMBER;
v_range_to NUMBER;
BEGIN
v_range_from := :P1_FY_FROM;
v_range_to := :P1_FY_TO;
v_query := 'SELECT ';
-- build the dynamic column selections by looping through the fiscal year range.
-- v_as is meant to specify the column name as (FY10, FY11, etc.), but it's not working.
FOR i IN v_range_from.. v_range_to LOOP
v_as := 'FY' || SUBSTR(i, 3, 4);
v_query := v_query || 'MAX(DECODE(FY_NB,' || i || ',PFH_HEADCOUNT,0)) '
|| v_as || ',';
END LOOP;
-- add the rest of the query to the dynamic column selection
v_query := rtrim(v_query,',') || ' FROM ('
|| 'SELECT FY_NB, PFH_HEADCOUNT FROM ('
|| 'SELECT FY_ID, FY_NB FROM FISCAL_YEAR) A '
|| 'LEFT OUTER JOIN ('
|| 'SELECT FY_ID, PFH_HEADCOUNT '
|| 'FROM PROJECT_FY_HEADCOUNT '
|| 'JOIN PROJECT_FY USING (PF_ID) '
|| 'WHERE PL_ID = ' || :P1_PROJECT || ') B '
|| 'ON A.FY_ID = B.FY_ID)';
RETURN v_query;
END;I need to invoke GET_QUERY_COLS(v_query) somewhere to get the column names, but I'm not sure where I need to call it and how to actually set the column names after getting the returned colon-delimited list.
Can you (or anyone else) please help me get a little further? Once again, feel free to login to my host account to see it first hand.
Thanks again!
Mark -
Hi Gurus
is it possible(any built in function or commands) changing columns name which moving out the data in the column.
create table xyz(x number);---it contains data
after change column name...it should be...
create table xyz(y number);sql>create table xyz(x number);
Table created.
sql>insert into xyz values (1);
1 row created.
sql>alter table xyz rename column x to y;
Table altered.
sql>select * from xyz;
Y
1
1 row selected. -
Resolve column names in a sql Query
Hi Folks,
I’m upgrading an application and there are database columns that have major changes that could affect production reports. I would like to survey v$SQL for a few days to see if these columns are affected. Here’s the problem.
Looking at a SQL query to determine which columns are used is not nearly as easy as it sounds. Are there any oracle functions or 3rd party tools that can be used to list the columns used by a sql query? (this gets extremely tricky when subqueries become involved)
For instance.
select
name, b.dep_id, employee_id
From emp a
Inner join v_department b on a.dep_id=b.dep_id
Columns used:+
Emp.name+
Departments.dep_id (under the view)+
Emp.employee_id+
Emp.dep_id (from the join)+If you're on > 10g, you can use dbms_xplan with "all" option.
It shows "column projection information" which is exactly what you want.
UKJA@ukja102> set serveroutput on
UKJA@ukja102>
UKJA@ukja102> drop table t1 purge;
Table dropped.
Elapsed: 00:00:00.03
UKJA@ukja102> create table t1(c1 int, c2 int);
Table created.
Elapsed: 00:00:00.03
UKJA@ukja102>
UKJA@ukja102> explain plan for
2 select
3 t1.c1, t1.c2, v.cnt
4 from t1,
5 (select /*+ no_merge */ c1, count(*) as cnt
6 from t1
7 group by c1) v
8 where
9 t1.c1 = v.c1
10 ;
Explained.
Elapsed: 00:00:00.01
UKJA@ukja102>
UKJA@ukja102> @plan_all
UKJA@ukja102> select * from table(dbms_xplan.display(null,null,'all'))
2 /
PLAN_TABLE_OUTPUT
Plan hash value: 536125944
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 52 | 6 (34)| 00:00:01 |
|* 1 | HASH JOIN | | 1 | 52 | 6 (34)| 00:00:01 |
| 2 | TABLE ACCESS FULL | T1 | 1 | 26 | 2 (0)| 00:00:01 |
| 3 | VIEW | | 1 | 26 | 3 (34)| 00:00:01 |
| 4 | HASH GROUP BY | | 1 | 13 | 3 (34)| 00:00:01 |
| 5 | TABLE ACCESS FULL| T1 | 1 | 13 | 2 (0)| 00:00:01 |
Query Block Name / Object Alias (identified by operation id):
1 - SEL$1
2 - SEL$1 / T1@SEL$1
3 - SEL$2 / V@SEL$1
4 - SEL$2
5 - SEL$2 / T1@SEL$2
Predicate Information (identified by operation id):
1 - access("T1"."C1"="V"."C1")
Column Projection Information (identified by operation id):
1 - (#keys=1) "T1"."C1"[NUMBER,22], "T1"."C2"[NUMBER,22],
"V"."CNT"[NUMBER,22]
2 - "T1"."C1"[NUMBER,22], "T1"."C2"[NUMBER,22]
3 - "V"."C1"[NUMBER,22], "V"."CNT"[NUMBER,22]
4 - (#keys=1) "C1"[NUMBER,22], COUNT(*)[22]
5 - "C1"[NUMBER,22]
Note
- dynamic sampling used for this statement
40 rows selected.
Elapsed: 00:00:00.01
UKJA@ukja102>
UKJA@ukja102>
UKJA@ukja102> @end
UKJA@ukja102> set echo offDion Cho -
Unable to reorder/change column names on interactive single row view
I have created an interactive report and grouped my columns to display nicely in a single row view report. However, once I initially add the columns to a group, I am unable to reorder them. I can move them up and down the list, but the changes don't save. Also, I have gone through column by column and unchecked the box that says Use Same Text for Single Row View and expanded the column name. However, the single row view still displays what is in the master report. I've tried closing out my browser completely and reopening, but I am still not seeing my changes. Any suggestions?
I also just stumbled about the "Use Same Text for Single Row View" option actually doing nothing - in Single Row View I still get the label text from "Column Heading", no matter what I enter in "Single Row View Label".
I had to adjust a column width using a span tag in the heading (as this seems to be the only way to do that - any other suggestions I found adding style information to the region header had no effect), and now that tag is displayed in the Single Row View label.
I can live with that for now, but it's not really nice.
Is this a known bug? Didn't find anything else in the forum regarding this problem so far.
Holger -
Changing column name in Line chart
Hello All,
We are BO 4.0 SP6.
We are creating WEBI reports which includes charts as well.
We have two columns " Current Period" and "Last Period" and using them in WEBI report and Line chart.
In the table I am displaying the column name " Current period " as "Oct-14" using some formula.
But I am not able to change the name in the chart.
Can we change the column name in the graph using some formulas? Please advice.
PFA the screenshot for your reference.
Regards
Prasad AmbatiHi,
Do not Drag it inside chart area .
Align Them above Legend Text ( Current Period ),
so that Actual Legend Text will be hidden . -
How can I change column name in ALV table in WebDynpro ABAP?
Hi Everyone,
I have created an ALV table in WebDynpro ABAP. I have created a context node and added the required attributes there - for the ALV display.
Now I want to change one columnn name of the ALV table.... Currently it is showing the description of the data element, which I don't want to show. I cannot create a new DE only for this purpose.
Please let me know how can I change the name of the column.
RegardsHi,
This may help you to define your own column text in the ALV Table of webdynpro.
see the below code.
Here 'STATUS_ICON' is the column of the the output display of the ALV Table of webdynpro.
"change the label of the report.
DATA: lr_weeknum TYPE REF TO cl_salv_wd_column.
CALL METHOD l_value->if_salv_wd_column_settings~get_column
EXPORTING
id = 'STATUS_ICON'
RECEIVING
value = lr_weeknum.
SET THE LABEL OF THE COLUMN
DATA: hr_weeknum TYPE REF TO cl_salv_wd_column_header.
CALL METHOD lr_weeknum->get_header
RECEIVING
value = hr_weeknum.
CALL METHOD lr_weeknum->set_resizable
EXPORTING
value = abap_false.
hr_weeknum->set_prop_ddic_binding_field(
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
set the text of the column
CALL METHOD hr_weeknum->set_text
EXPORTING
value = 'C Form'.
regarads,
balu -
How do i change column names in oracle model?
Hi,
I am performing a migration from SQL SERVER 7.0 to Oracle 8.1.7.
I have tables that have tables in SQL SERVER with column names
that are "TYPE" and "BODY".(These are generally TEXT datatype
columns that need to be converted to LONG in Oracle.We need
these to be LONG datatype in Oracle because of an application we
are using. LOBS cannot be allowed)
The migration utility renames these columns as "TYPE_"
and "BODY_" and creates the tables in the Oracle Database.
I need to have these tables in Oracle with the same column names
viz. "TYPE" and "BODY" .
I can create new tables in Oracle with the column names "TYPE"
and "BODY" but cannot change the options in the migration
workbench for this.
Is there any option or any workaround I can use to change the
column names in the Oracle model?or set the options so that the
Oracle model tables donot modify these column names?
Thanks in advance for all the help.
MandarThe words 'TYPE' and 'BODY' are reserved Oracle words. Its best
to go along with what the workbench has suggested. If you have
to keep the original names of the columns trying wrapping double
quotes around them after the data migration is complete. This
may cause a case sensitivity or referential problem later on
though. -
Changing column name in a table
Is there any option for changing the name of a column of a table, apart from changing the datatype or size? If so, from which version this has been introduced and how it has to be done? Please give the syntax if any.
A quick check of the online documentation shows RENAME COLUMN was introduced in 9.2 ...
ALTER TABLE ...
RENAME COLUMN ... TO ...Richard -
How to change column names in dimension and cube views?
whenever AWM creates a view on a dimension or cube, it creates columns for long and short description with full name
forexanmpel, it creates like
CREATE OR REPLACE VIEW OLAPTRAIN.CHANNEL_VIEW
AS
SELECT
"DIM_KEY",
"LEVEL_NAME",
"MEMBER_TYPE",
"DIM_ORDER",
"LONG_DESCRIPTION",
"SHORT_DESCRIPTION",
"ALL_CHANNELS_LONG_DESCRI",
"ALL_CHANNELS_SHORT_DESCR",
"CLASS_LONG_DESCRIPTION",
"CLASS_SHORT_DESCRIPTION",
"CHANNEL_LONG_DESCRIPTION",
"CHANNEL_SHORT_DESCRIPTIO",
"CHANNEL_TYPE",
"CHANNEL_CHANNEL_TYPE",
"CHANNEL_ALL_CHANNELS_ID",
"CHANNEL_CLASS_ID",
"CHANNEL_CHANNEL_ID"
FROM TABLE(CUBE_TABLE('"OLAPTRAIN"."CHANNEL"') );
what is the way to customize the column name? for example for class level, how can we say insterad of long_description and short_description, use LONG and SHORT simply?
i also see the size of long and short descriptions are set to varchar2(60) and varchar2(20), is there a way to change that for each level in AWM?
ThanksHi there,
I don't think there is a way to control the column names within the OLAP product itself, but if this is something you really want to do, have you tried creating your own views?
As you can see, the syntax is pretty simple
Thanks,
Stuart Bunby
OLAP Blog: http://oracleOLAP.blogspot.com
OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
OLAP on OTN: http://www.oracle.com/technology/products/bi/olap/index.html
DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html -
Change column name in Gridcontrol?
Greetings:
Could not figure out how to change displayed name of columns
in gridcontrol. They always match attributes in the underlying view.
But that view wizard does not let me specify meaningful names
(e.g. blanks are not accepted).
TIA,
V.If it is DAC
use setLabel on corresponding AttributeInfo
Assuming you are using JClient, You can set the label using the UI Hint on the corresponding attribute.
Select the view object, then select the attribute in structure pane and then invoke the attribute editor. Specify 'Label text' control hint.
Greetings:
Could not figure out how to change displayed name of columns
in gridcontrol. They always match attributes in the underlying view.
But that view wizard does not let me specify meaningful names
(e.g. blanks are not accepted).
TIA,
V. -
Changed server name, lost all local folders
Greetings,
Recently my hosting company migrated me to a new server. Thing is, not only is a new server, but also new name. This AM I figured I had to finally address the issue so I made what I've come to learn is a mistake - I went into Tools -> Account Settings and changed the name of the server from "A" to "B". Oops. The account is an IMAP account, and has been for years.
This probably wouldn't be a big deal, but at the same time, something very odd happened - all of my LOCAL folders disappeared. So figured ok, something screwy happened I'll just go find the files. Not that easy...
- If I search my hard drive for the name of a folder that was in the local folders, the search turns up empty. The folders appear to just be gone. Checked recycling bin, nothing there.
- I went into Thunderbird to see where local folders are kept. Easy enough: D:\xxxxx\Mail\Local Folders. Went looking there. Mostly empty. What IS there has 0kB. Considering I have (well... had?) about 15-20 years of email stored, this isn't likely.
- I even scanned the drives with both Recuva and VirtualLabs Data Recovery. Both turned up nothing for the missing folders.
I tried looking through the support sites, and tried a few of the "obvious" solutions:
- View has both "messages" and "threads" set to "all".
- I've restored a pref.js file from a few days ago
So I'm stumped. Am I missing somewhere that I should be looking? Am I missing a solution?
Version of Thunderbird is 31.6.0.
Any help is greatly appreciated.
Thanks!Hi Matt,
Thanks for the quick response. I agree that it would seem like two different issues, but... coincidence?
The server migration in question was supposed to be seamless. I believe the servers were mirrored for a time, and then the original server was shut down. This is supported by the fact that my mailboxes on the "B" server were all in tact, including the entire IMAP folder tree (about 20-30 sub folders within the inbox). Those folder did not disappear with the migration/server name change.
As for the "local folders"... I was/am very certain they were indeed local, but I tried to find some evidence. I was intermittently using Mailstore Home to run mail backups, and looking in there, I see all the missing folders, and they are indeed "local folders". Not IMAP subfolders.
Thanks again! -
HTML DB Chang column name dynamically
Can I change the column name dynamically. for instance
Today run my apply it will display the title of the columns this
Column title: Wed Thu Fri
04/22/05 04/23/05 04/24/05
Data 45 34 34
54 56 23
Next week
Column title: Wed Thu Fri
05/03/05 05/04/05 05/05/05
45 34 34
54 56 23
The date Change Dynamically?Go to your report and open report atributes. There you can choose the options for column names. Click on the pl/sql function and type this in:
DECLARE v varchar2(20);
begin
v := to_char(SYSDATE, 'dd.mm.yy')||':'||to_char(SYSDATE+1, 'dd.mm.yy');
RETURN v;
END;
This will set the first two columns to the specified dates. You can use this as one option.
If the case is more complicated than you can do the following:
1. create a number of items on your page - hidden
2. compute the items with values once the page is loaded
3. use item substitute string &ITEM. in the column name, which will use the item value as a name for the column.
This way you are more flexible since you can use the item values for some columns only and have the other columns hardcoded.
Denes Kubicek
Maybe you are looking for
-
I had my itunes on one of my few computers that I have. The hard drive on the computer that I had my itunes on went out and I had to replace it, losing my itunes and other things, but I cared more about the itunes then I did with anything else. Now w
-
Exporting in Premiere Pro with a GTX 980 CUDA takes 4 hours
Okay, this problem has been plaguing me ever since I upgraded to a new PC with some very high end hardware. I'm trying to export a 25 minute h.264 encoded mp4 file from an AVI video and PCM audio source, however, exporting it using YouTube 1080p pres
-
FB03: Report that identifies which ACCTG Documents have PDF's attached?
Hello Friends- I have an usual request. When my accounting team executes journal entries, they attach a PDF for every transaction. When audited, they discovered several document numbers where the user forgot to add the PDF. Is there a report or a
-
Library stored on NFS share?
All, Thinking about a new MB Air, but I've got a 65GB iTunes Library. When I'm not at home, I have my iPhone with me, so I listen to music there. When I'm at home, my WLAN is 802.11n, and my NAS has a 2x1G LAG connecting it to the network. I'm think
-
I have a Lexmark printer which is a little old. So when i connect my iphone to it via the USB cable my printer doesn't recognise it. If i bought a bluetooth adaptor for the printer would i be able to print photos via bluetooth?