Dynamically assign column names in reports
I have a report that has to display the data for the years within the given date range.
For example, for customer A I need to display order value placed in each year between the date range 01-dec-2010 till 31-dec-2014.
From Date : 01-dec-2010 To Date :31-dec-2014
Output should be a follows :
Customer 2010 2011 2012 2013 2014
A 50 40 60 100 20
This means that if the date range is 2010 to 2015 then output will be as follows
Customer 2010 2011 2012 2013 2014 2015
A 50 40 60 100 20 50
So the report column name must change accoding to the Fm/To Period range
Please tell me the coding for dynamically changing report column names as per the parameters 'From Dt' and 'To Dt'.
Hi,
First and best option I will recommend is to create a MATRIX report.
Second option if the number of columns are fixed,
create fixed no of date ranges as parameters or placeholder columns (can be achieved even with 2 parameters start date and end date), you just need to use DATE is formula calculations cleverly.
Now create formula columns and pass the date ranges as parameters to the respective column formulas.
Best Regards
Arif Khadas
Similar Messages
-
Dynamically selecting column names in report builder ???
Dear members,
I have a requirement in which the user dynamically selects the tables column names. Like suppose take DEPT table. My query would be
select &P Report from dept;
so if the user selects DNAME then i would get the dname values and so on... This is fine but if one gives the value for the lexical parameter as DEPTNO,DNAME then i should get two columns in my report output. The select statement then becomes
select DEPTNO,DNAME Report from dept;
But i am not able to do this in report builder(6i). If i use just one value for the parameter then i get the o/p but if i use more than one (eg: DEPTNO,DNAME) then its giving an error.when i run this query through toad or sql plus then i am getting the desired o/p but wher as in report builder i am not able to get the o/p.
My report triggers are :
Before Parameter form :
:P := NULL;
After parameter Form :
function AfterPForm return boolean is
begin
IF :P = 'DNAME,DEPTNO' THEN
:P := ' DNAME,DEPTNO ' ;
ELSE
:P := NULL;
END IF;
return (TRUE);
end;
Your comments and suggestions are welcomed.
thanks
regards
sandeepNumber of columns can not be changed at run time. If your data model has three columns, lexical parameter should pass 3 values. If you have query like this in data model:
select &p_1 from table
Whatevere you have as initial value in user parameter p_1, data model captures that info. -
Dynamically assign column heading to Report columns
I need to assign values to column headings of various Report Columns of my Report region based on current value of one of my application items. How can I do it?
Never mind, there was another post like this. Duplicate. Just in case someone is looking for the answer, here is what worked for me:
Assume the Application item is called app_item_My_dynamic_head_col1.
Add a page computation before the page loads to set the value of the application item based on whatever condition.
Edit the report column.
In place of hard coded column heading "Project Name" (that was my column heading), replace it with
&app_item_My_dynamic_head_col1.
The key here is the period after &app_item_My_dynamic_head_col1.
As the page loads, the column heading will be value of the app_item_My_dynamic_head_col1 (as assigned by the computation). -
Function short dump - A dynamically specified column name is unknown.
Hello,
I've created BRF fuction according to the Note 1466868 - Dunning by collection strategy with BRFplus. I get short dump during simulation of function with following exception:
"A dynamically specified column name is unknown. "
Runtime Errors SAPSQL_INVALID_FIELDNAME
Exception CX_SY_DYNAMIC_OSQL_SEMANTICS
No. Ty. Program Include Line
Name
19 METHOD CL_FDT_ELEMENT================CP CL_FDT_ELEMENT================CM012 129
CL_FDT_ELEMENT=>GET_VALUES_DDIC
18 METHOD CL_FDT_ELEMENT================CP CL_FDT_ELEMENT================CM011 124
CL_FDT_ELEMENT=>GET_VALUES
17 METHOD CL_FDT_WD_RENDER_VALUE_INPUT==CP CL_FDT_WD_RENDER_VALUE_INPUT==CM00G 139
CL_FDT_WD_RENDER_VALUE_INPUT=>VALIDATE_VALUES
In my opinion there is uncorrect query.
Current version:
. SELECT FIKRS AS VALUE NAME AS TEXT FROM FMBS_BS_T
INTO CORRESPONDING FIELDS OF TABLE lt_value
WHERE LANGU EQ 'E'.
instead of:
. SELECT FM_AREA AS VALUE NAME AS TEXT FROM FMBS_BS_T
INTO CORRESPONDING FIELDS OF TABLE lt_value
WHERE LANGU EQ 'E'.
My sap version:
EHP4 FOR SAP ERP 6.0 / NW7.01
SAP_BASIS 701 0003 SAPKB70103
Do you know any note or solution to resolve this problem.
Best regards,
Jacek WitczakHi, I came back to working on "Dunning by collection strategy with BRFplus". According to your sugestions, I raised the level of components:
SAP_BASIS Level 09
SAP_ABA level 09
PI_BASIS level 09
SAP_BW level 09
But still I have the same short dump.
Shoudl we raise any other components? Maybe you know note, which resolve this problem? -
How to dynamically set column name in Answers
Hi.
How to dynamically set column name in Answers, for example I want to put presentation variable in column header. Is this possible?
Regards,
Goran Ocko
http://108obiee.blogspot.com/May be a rude way .. but it works.
Add narrative view and use Java script to change the column headings based on the variables.
<script language="javascript" type="text/javascript">
var a = document.getElementById('idResultsTableParent');
var rows= a.getElementsByTagName('tr');
rows[1].cells[1].innerText ="@{Presentation Variable}";
</script>
Editing the same post to remove irrelevant information.
- Girish -
Need to create a dynamic caption(column name) in a dynamic table
Hi All,
I have created dynamic table .But the dynamic column is not showing.I have created two column name that is name and empId .I have tried with following code
IWDCaption nameCap=(IWDCaption)view.createElement(IWDCaption.class,"nameCap");
nameCap.setText("Name");
tabColumn1.setHeader((IWDCaption)nameCap);
IWDCaption addCap=(IWDCaption)view.createElement(IWDCaption.class,"addCap");
addCap.setText("Address");
tabColumn2.setHeader((IWDCaption)addCap);
I m getting internal server error...But When i m comented the above code i can able to see tha dynamic table withput column name..Can anyone help me
SumanHi
IWDTableColumn tabColumn1 = (IWDTableColumn)view.createElement(IWDTableColumn.class,"N_Co");
IWDTableColumn tabColumn2 = (IWDTableColumn)view.createElement(IWDTableColumn.class,"A_Co");
IWDInputField nameText = (IWDInputField)view.createElement(IWDInputField.class,"N_Text");
nameText.bindValue(attrib1);
tabColumn1.setTableCellEditor((IWDTableCellEditor)nameText);
IWDInputField addText = (IWDInputField)view.createElement(IWDInputField.class,"A_Text");
addText.bindValue(attrib2);
tabColumn2.setTableCellEditor((IWDTableCellEditor)addText);
<b>I need to see the column name.....</b>
for that i have written the following code...
while writting the following code i m getting internal server error
IWDCaption nameCap = (IWDCaption)view.createElement(IWDCaption.class,"nameCap");
nameCap.setText("contribution_area");
tabColumn1.setHeader((IWDCaption)nameCap);
IWDCaption addCap=(IWDCaption)view.createElement(IWDCaption.class,"addCap");
addCap.setText("SUM");
tabColumn2.setHeader((IWDCaption)addCap); -
Dynamically assign series names for SVG Chart
I have created a line chart with 5 series in it. I would like the legend name for each series to be dynamically assigned (as a value from a field in the database). Is this possible?
Ideally, i'd also like the number of series to be variable too. Is this possible?Hi,
I am trying to use the code you gave me above (which normally works fine). But when I put it in the query below with 3 ' (3 quotes) it fails.
Any ideas?
Thanks
Owen
return
'SELECT null link, month label, sumamt "'||:P4_FY||'"
FROM
SELECT
month
, CASE
WHEN MONTH = '''JUN''' THEN 1
WHEN MONTH = '''JUL''' THEN 2
WHEN MONTH = '''AUG''' THEN 3
WHEN MONTH = '''SEP''' THEN 4
WHEN MONTH = '''OCT''' THEN 5
WHEN MONTH = '''NOV''' THEN 6
WHEN MONTH = '''DEC''' THEN 7
WHEN MONTH = '''JAN''' THEN 8
WHEN MONTH = '''FEB''' THEN 9
WHEN MONTH = '''MAR''' THEN 10
WHEN MONTH = '''APR''' THEN 11
WHEN MONTH = '''MAY''' THEN 12
END AS SORT_ORDER
, sumamt
FROM
Select month
, sum(DEAL_VALUE_SUM) sumamt
from my_deals
where country = :P8_COUNTRY
and FY = :P8_FY
group by month))
ORDER BY SORT_ORDER'; -
Crystal Report - NULL values mapped to Column names in reports
Hai,
I am using rows of data retrived from the SQL Server 2005 Express and sometimes the column names are NULL , I want to set a default value to this NULL value and set it as Data axes label / Group axes values, can some one please help me with this issue.
Thank you in advance.
VijayI resolved this issue myself, this can be set as other Data Labels, Group Label or Series Riser's properties too, left-click twice until the blank item is selected and then right click and select "Edit Axis Label" item and here it can edited with the new value(text).
-
Dynamically assigning field name and field value
Hi all,
logic:
select field1 field2 from table into workarea.
workarea-field1 will have value as 'MATNR' or 'BUKRS' or 'KUNNR' or............etc
workarea-field1 will have values as '10000025' or '2010' or '102536' or ............etc
Now i need to dynamically assign MATNR = 10000025
or BUKRS =2010
or KUNNR = 102536
HOW CAN WE DO THIS.Hi,
Use the ASSIGN COMPONENT statement.
Regards,
Ankur Parab -
Dynamic comparison column in Bex report
Hi Gurus
I have the following request, could any of you kindly help me out?
Content example in Cube:
GL Act| Fiscyear| Fiscper3| Amount
10001 |2004 |12 |100
Report: Cross-year comparison determined by period
Specifying fiscyear and period range is enabled as user-input, e.g. choose year 2003 to 2005 and period 01 to 03
The following layout is our target:
header: period 01-03
GL Act| Y2003| Var2003-2004| Y2004| Var2004-2005| Y2005
10001 | 100 | 200 | 300 | -100 | 200
10002 | 300 | 500 | 800 | 200 |1000
I think the point is to achieve the "variance" column which is dynamically determined by fiscyear where user inputs, since restricted key figure cannot achieve the "dynamic" solution.
Thanks in advance!Hi Eric,
My approach is somewhat not flexibible but it may suit your needs.
Will try to describe it in more details.
Lets assume that this periods contain full information: a year and a period within a year and that there are 12 periods in the year. A user enters a a range of periods P1 P2 (lets say of 2005) and wants to compare some KF for the given time period with that for 2004, 2003 and calculate difference between periods.
Solution:
Create two for P1 and P2. All vars are user entry ones. If P1 is always the first period in the year then P1 might be determined in the user exit.
Create a structure in rows.
New selection. Name it as Y2003. Put here your KF and Fiscal year/period. Restrict it with P1 24, P2 24.
New selection. Name it as Y2004. Put here your KF and Fiscal year/period. Restrict it with P1 12, P2 12.
New selection. Name it as Y2005. Put here your KF and Fiscal year/period. Restrict it with P1, P2.
New formula for Var2003-2004. Place into formula Y2004 - Y2003.
New formula for Var2004-2005. Place into formula Y2005 - Y2005.
Regardless of selections names this query will show values for given periods of 3 years: entered, year before entered and entered -2.
Best regards,
Eugene -
Mismatch column name in report viewer and PDF export?
I have text box in the header and populated dynamically.
If my query result is more than 1 page, when i go to next page, the column value will change but when i export it to PDF or Word, only the column value of the first page will appear.
Please see image below:
http://s2.postimg.org/3q81agpyh/Cropper_Capture_26.jpg
What's wrong here?Hi Arun,
Here's the screenshot of the problem
-> {http://}i.imgur.com/2hGf3xi{.jpg}
Is the textbox is placed within report body or in the page header.
-> It's in the body/tablix, please see image below
->{http://}i.imgur.com/hiO0R8C{.jpg}
Can you provide the expression you have used in that text box
-> =ReportItems!STORENOG1.Value
-> I have a textbox STORENOG1 which is hidden (=Fields!STORENOG1.Value)
This is how I declare in my Stored Proc
-> STORENOG1 VARCHAR(10) DEFAULT NULL
Please remove the curly braces in the links bec. I cannot paste link and upload images
Regards,
Tats -
Dynamically assigning table name in select statement
how can i assign the table name dynamically in Select statement?
i tried following code
create or replace procedure proc1
as
x varchar2(100);
y varchar2(10);
begin
x='UNIT_MASTER';
execute immediate 'select unit_code into y from x where
rownum=1';
dbms_output.put_line(y);
end;
the procedure is created but when i execute the procedure the
error is shown in the execute immediate statementDo the following :
Create or replace procedure pro1 as
x varchar2(100);
y varchar2(10);
begin
x := 'UNIT_MASTER';
EXECUTE IMMEDIATE 'select unit_code from '||x||' where rownum
= 1' INTO y;
dbms_output.put_line(y); -
Dynamic add column in Bex report
Hi all,
we have input parameter is month wise. For example if i have input 12.2011 - 03.2012
Output:
12.2011--01.2012--02.2012-----04.2012
50kg -
70--90--
54
Like above dynamically have to change column based on month input parameter. Please guide me how to design bex query.
Thanks
Saravananhi,
restrict calmonth with variable type manual input, and put this calmonth in columns on top of amount or quantity. It will give you your desired output.
hope this helps,
regards,
ray
Edited by: ray100 on Mar 9, 2012 2:54 PM -
Items in project report(query) are listed under the "not assigned" (column)
Hi All,
Items in project reports (query) are listed under the "not assigned" (column name) Why it is so ?
Start query : project reports & ask for period April 2008 (Period from/to). .
You will see items listed under Not assigned WBS Element (column name)
If you choose for a period of April until June 2008 then you see more items under u201Cnot assignedu201D .
Items should be under Assigned (column name) & not under the Not assigned (column name )
Any suggestions highly appreciable.
Thanks.Hi,
How are you displaying the ITEM field in the BEx query designer? Is it displayed with "Key and Text"? If so and if the text is not loaded for this master, this may happen.
Regards,
Yogesh. -
Dynamically change column heading without Dashboard Prompt
Hi All,
My requirement is change the column heading dynamically in a report. I have achieved this through setting the presentation variable to the dashboard prompt.
I have 5 columns in the dashboard prompt. Out of these 5 columns, I want to use only 1 column as dashboard prompt.
But still I want to dynamically change the column heading of the other 4 columns based on the only 1 column selected in the dashboard prompt.
Is there anyway to achieve this?You need to have some logic to change other 4 columns based on 1 selected column.. where you want put that logic?
BTW: Check these
http://total-bi.com/2011/03/obiee-dynamic-column-headings/
http://rampradeeppakalapati.blogspot.com/2012/02/dynamically-change-column-names-in.html
If helps mark or also update back if you are thru with this.
Maybe you are looking for
-
How to compile a procedure from Sql*Plus?
Dear friends, I couldnt find the way how to compile my invalid procedure through sql*Plus. I know this is very awkward,but I m in need of that command only. Thanks Ritesh Sharma
-
UXGA via DVI on G3ti200-Pro TD?
Hi, I'm the proud owner of an MSI G3Ti200 proTD vga card, I bought it almost 1 year ago, and never a glitch, never a fault. This card works flawlessly. but I have a question to you guys (especially technically skilled onez) QUESTION 1) I'd like to bu
-
Hi All, I have encounted a case that user deleted the PO line item after GR, SO invoice. Our MM expert managed to undeleted the PO line item, but the S.O. pricing condition XP03 does not get updated. Is there any way we can update the pricing ?? I
-
Google - web/images/maps bar is on top, not on side
google search results used to have the news/images/maps listings on the left of the results page. now they are on the top of the results page. this is not the case in chrome, so I think something changed, but I cannot figure it out. I know my 8 year
-
Cant Even Get 6 When Building Next Door Gets 80MB!...
Cant Even Get 6 When Building Next Door Gets 80MB!??! I Live in a small city called bangor and our estimate Bandwith is 6-8MB (Terrible) and the university next to my house has got 80! Why Should We Suffer When they get 84MB/S we live in the city. In