Data with two rows in a single column
I have been working on a report with the customer due amounts shown in bucketed columns eg 1-30 , 31-60 etc for each Customer,
so for each column I want to show an additional row with the % of the due amounts for each bucketed column.
. The format of report should look like below in pivot/table view
|Customer| |Due1-30 | Due31-60 | Due60+ | Total |
|XYZ | | 3000 | 2000 | 5000 | 10000 |
| |%Due | 30% | 20% | 50% | 100% |
ABC….
I have to get the percentages on the measure values in a separate row(not as a seperate column). Could you please help me how to get result like the format what I have shown
Thanks,
BP
Edited by: user8116383 on May 6, 2011 8:55 AM
Hi
This can be achievable by using Pivot view.
1.In Columns field place the customer and place the measure lables in the rows field and the measure column in measure field.
2.Duplicate the measure column and name it as %Due and click more options on this duplicated column and click shown data as -> percent of -> Row
Thanks
Diney
Similar Messages
-
Create a view to shows data from multiple rows in a single column
Hi all - this is probably posted in the wrong forum but I couldn't find which was the correct one.
I am almost a complete novice at sql but I have a need to create a view which can be developed at 10g (which runs efficiently as the volumes are likely to be high) which will do the following.
Original table with columns Parent_code, Child_code
Parent_Code Child_Code
1000 2000
1000 3000
1000 4000
2000 3000
2000 5000
(note Parents can have multiple children and a child can have multiple parents!)
What I need to end up with in my view is the following
Child_Code Parent_List
2000 '1000 (3)'
3000 '1000 (3), 2000 (2)'
4000 '1000 (3)'
5000 '2000 (2)'
Note the number in parantheses is the number of children that the parent has - ie in the original table parent 1000 has 3 rows (one for each child)
This view is then to be used as a look up (on child code) for a business objects report.
Is there anyone who could PLEASE, PLEASE help me fairly quickly on this as I have very little time to find a solution?Hi,
You can test these ones :
select child_code
, ltrim(sys_connect_by_path(parent_info,', '), ', ') as parent_list
from (
select child_code
, to_char(parent_code) ||
' (' ||
count(*) over(partition by parent_code) ||
')' as parent_info
, row_number() over(partition by child_code order by parent_code) rn
from your_table
where connect_by_isleaf = 1
connect by prior rn = rn-1
and prior child_code = child_code
start with rn = 1
select child_code,
rtrim(
extract(
xmlagg(xmlelement("e",parent_info||', ') order by parent_info)
, '//text()'
) as parent_list
from (
select child_code,
to_char(parent_code) ||
' (' ||
count(*) over(partition by parent_code) ||
')' as parent_info
from your_table
group by child_code
;What you need is called "string aggregation".
See here for various techniques, including the two above : http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php -
Insert data from two rows into a single row in a new table
Hi
i have a table like the following
Deptno Dname Salary
10 Computer 2000
10 Computer 4000
10 Computer 3000
10 Science 6000
10 Science 1000
10 Science 4000
10 Science 10000
I want to insert data into a new table like the following
Deptno MaxSalCom Minsalcom MinSalSci MaxSaSci
10 2000 4000 1000 10000
Deptno--As in Table1
MaxSalCom--Maximum salary for Dname " Computer"
Minsalcom--Minimum salary for Dname " Computer"
MaxSalSci--Maximum salary for Dname " Science"
MinsalSci--Minimum salary for Dname " Science"
Please help me how to go about itwith data as
(select 10 dno, 'Computer' dname, 2000 sal FROM dual
union all
select 10, 'Computer', 4000 FROM dual
union all
select 10, 'Computer', 3000 FROM dual
UNION all
select 10, 'Science', 6000 FROM dual
union all
select 10, 'Science', 1000 FROM dual
union all
select 10, 'Science', 4000 FROM dual
union all
select 10, 'Science', 10000 FROM dual
select dno, min(decode(dname,'Computer',sal)) min_sal_comp , max(decode(dname,'Computer',sal)) max_sal_comp,
min(decode(dname,'Science',sal))min_sal_sci , max(decode(dname,'Science',sal)) max_sal_sci
from data
group by dno; -
I want to create an ALV with two row fields name
Hi
I want to create an ALV with two row fields name. please suggest how to do it or send some sample code
thanksHi,
see this link
http://****************/Tutorials/ALV/ALVMainPage.htm
http://www.alvrobot.com.ar/tutorial.php
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b09ac4d5-e3ad-2910-6a81-96d1b861928c
http://abapprogramming.blogspot.com/2007/11/alv-check-boxes-sample-code.html
REPORT zalv5 NO STANDARD PAGE HEADING.
Description----
TOPICS INTRODUCED:
1. Learn about the u2018Standardu2019 PF-Status that comes as default.
2. Exclude function codes from u2018Standardu2019 PF-Status and customize it.
TYPE-POOLS: slis.
DATA: BEGIN OF i_data OCCURS 0,
qmnum LIKE qmel-qmnum,
qmart LIKE qmel-qmart,
qmtxt LIKE qmel-qmtxt,
ws_row TYPE i,
ws_char(5) TYPE c,
chk,
END OF i_data.
DATA: report_id LIKE sy-repid.
DATA: ws_title TYPE lvc_title VALUE 'An ALV Report'.
DATA: i_layout TYPE slis_layout_alv.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: i_events TYPE slis_t_event.
DATA: i_header TYPE slis_t_listheader.
DATA: i_extab TYPE slis_t_extab.
SELECT qmnum
qmart
qmtxt
INTO TABLE i_data
FROM qmel
WHERE qmnum <= '00030000010'. LOOP AT i_data. i_data-ws_row = sy-tabix. i_data-ws_char = 'AAAAA'. MODIFY i_data. ENDLOOP. report_id = sy-repid. PERFORM f1000_layout_init CHANGING i_layout. PERFORM f2000_fieldcat_init CHANGING i_fieldcat. PERFORM f3000_build_header CHANGING i_header. PERFORM f4000_events_init CHANGING i_events. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * I_INTERFACE_CHECK = ' ' * I_BYPASSING_BUFFER = * I_BUFFER_ACTIVE = ' ' i_callback_program = report_id * I_CALLBACK_PF_STATUS_SET = ' ' * I_CALLBACK_USER_COMMAND = ' ' * I_CALLBACK_TOP_OF_PAGE = ' ' * I_CALLBACK_HTML_TOP_OF_PAGE = ' ' * I_CALLBACK_HTML_END_OF_LIST = ' ' * i_structure_name = ' ' * I_BACKGROUND_ID = ' ' i_grid_title = ws_title * I_GRID_SETTINGS = is_layout = i_layout it_fieldcat = i_fieldcat * IT_EXCLUDING = * IT_SPECIAL_GROUPS = * IT_SORT = * IT_FILTER = * IS_SEL_HIDE = * I_DEFAULT = 'X' i_save = 'A' * IS_VARIANT = it_events = i_events * IT_EVENT_EXIT = * IS_PRINT = * IS_REPREP_ID = * I_SCREEN_START_COLUMN = 0 * I_SCREEN_START_LINE = 0 * I_SCREEN_END_COLUMN = 0 * I_SCREEN_END_LINE = 0 * IT_ALV_GRAPHICS = * IT_ADD_FIELDCAT = * IT_HYPERLINK = * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = TABLES t_outtab = i_data EXCEPTIONS program_error = 1 OTHERS = 2 . IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Form F1000_Layout_Init
FORM f1000_layout_init USING i_layout TYPE slis_layout_alv.
CLEAR i_layout.
i_layout-colwidth_optimize = 'X'.
i_layout-edit = 'X'.
ENDFORM. " F1000_Layout_Init
*& Form f2000_fieldcat_init
FORM f2000_fieldcat_init CHANGING i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: line_fieldcat TYPE slis_fieldcat_alv.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'QMNUM'. " The field name and the table
line_fieldcat-tabname = 'I_DATA'. " name are the two minimum req.
line_fieldcat-key = 'X'. " Specifies the column as a key (Blue)
line_fieldcat-seltext_m = 'Notification No.'. " Column Header
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'QMART'.
line_fieldcat-ref_tabname = 'I_DATA'.
line_fieldcat-hotspot = 'X'. " Shows the field as a hotspot.
line_fieldcat-seltext_m = 'Notif Type'.
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'QMTXT'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-seltext_m = 'Description'.
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'WS_ROW'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-seltext_m = 'Row Number'.
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'WS_CHAR'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-seltext_l = 'Test Character Field'.
line_fieldcat-datatype = 'CHAR'.
line_fieldcat-outputlen = '15'. " You can specify the width of a
APPEND line_fieldcat TO i_fieldcat. " column.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'CHK'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-seltext_l = 'Checkbox'.
line_fieldcat-checkbox = 'X'. " Display this field as a checkbox
line_fieldcat-edit = 'X'. " This option ensures that you can
" edit the checkbox. Else it will
" be protected.
APPEND line_fieldcat TO i_fieldcat.
ENDFORM. " f2000_fieldcat_init
*& Form f3000_build_header
FORM f3000_build_header USING i_header TYPE slis_t_listheader.
DATA: gs_line TYPE slis_listheader.
CLEAR gs_line.
gs_line-typ = 'H'.
gs_line-info = 'This is line of type HEADER'.
APPEND gs_line TO i_header.
CLEAR gs_line.
gs_line-typ = 'S'.
gs_line-key = 'STATUS 1'.
gs_line-info = 'This is line of type STATUS'.
APPEND gs_line TO i_header.
gs_line-key = 'STATUS 2'.
gs_line-info = 'This is also line of type STATUS'.
APPEND gs_line TO i_header.
CLEAR gs_line.
gs_line-typ = 'A'.
gs_line-info = 'This is line of type ACTION'.
APPEND gs_line TO i_header.
ENDFORM. " f3000_build_header
*& Form f4000_events_init
FORM f4000_events_init CHANGING i_events TYPE slis_t_event.
DATA: line_event TYPE slis_alv_event.
CLEAR line_event.
line_event-name = 'TOP_OF_PAGE'.
line_event-form = 'F4100_TOP_OF_PAGE'.
APPEND line_event TO i_events.
CLEAR line_event.
line_event-name = 'PF_STATUS_SET'.
line_event-form = 'F4200_PF_STATUS_SET'.
APPEND line_event TO i_events.
ENDFORM. " f3000_events_init
FORM F4100_TOP_OF_PAGE *
FORM f4100_top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_header.
ENDFORM.
FORM F4200_PF_STATUS_SET *
FORM f4200_pf_status_set USING i_extab TYPE slis_t_extab.
REFRESH i_extab.
PERFORM f4210_exclude_fcodes CHANGING i_extab.
SET PF-STATUS 'STANDARD' OF PROGRAM 'SAPLSALV' EXCLUDING i_extab.
ENDFORM.
*& Form f4210_exclude_fcodes
FORM f4210_exclude_fcodes USING i_extab TYPE slis_t_extab.
DATA: ws_fcode TYPE slis_extab.
CLEAR ws_fcode.
ws_fcode = '&EB9'. " Call up Report.
APPEND ws_fcode TO i_extab.
ws_fcode = '&ABC'. " ABC Analysis.
APPEND ws_fcode TO i_extab.
ws_fcode = '&NFO'. " Info Select.
APPEND ws_fcode TO i_extab.
ws_fcode = '&LFO'. " Information.
APPEND ws_fcode TO i_extab.
ENDFORM. " f4210_exclude_fcodes
thanks
karthik
reward me if usefull -
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 -
Displaying Document Name With The Summary in a Single Column Using Document Library View.
Hi All,
I have a question that relates to SharePoint Document Library Views. I want to view the Documents name with the summary in a single column. Below image shows an example of it. I need this within a SharePoint Document Library. Also I want the height of the
row to be increased more than the default height. I cannot figure it out how to do that? Could you someone help me to do this. I have inserted the Document Library as an App Part to the page.
So could you someone help me to solve this matter?
Thanks and regards,
ChiranthakaHI Chiranthaka,
You can create DataView webpart using SPD and then modify the display template according to your need.
http://deannaschneider.wordpress.com/2012/07/10/item-counts-dvwp-sp2010/
Hope this will help to solve your problem.
Best Regards,
Brij K -
How to create a custom layout with two rows
hi ,
i have a requirement of creating the portal page layout with two rows. First row has one container with 100% width and second row has 3 columns (30:40:30).
How to create the layout?
what are the modification in portapp.xml?
Thanks and regards,
SaravananHi,
Check this:
http://help.sap.com/saphelp_nw2004s/helpdata/en/42/efa44d27a21a7de10000000a422035/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/42/efbac120711a71e10000000a422035/content.htm
Here is example portalapp.xml:
<?xml version="1.0" encoding="utf-8"?>
<application>
<!THIS FILE IS A COPY OF THE ORIGINAL VERSION STORED IN THE PCD. PLEASE DO NOT CHANGE IT!>
<application-config>
<property name="Vendor" value="sap.com"/>
<property name="SecurityArea" value="NetWeaver.Portal"/>
<property name="SharingReference" value="com.sap.portal.htmlb,com.sap.portal.useragent,com.sap.portal.pagebuilder"/>
</application-config>
<components>
<component name="fullWidth">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="1 Column (Full Width)"/>
<property name="com.sap.portal.pcm.Description" value="Layout displaying one full-width column"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TagLibHtmlb" value="/SERVICE/com.sap.portal.htmlb/taglib/htmlb.tld "/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="fullWidth.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConF"/>
</property>
</component-profile>
</component>
<component name="light_fullWidth">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="EPCFLevel" value="0"/>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="Light 1 Column (Full Width)"/>
<property name="com.sap.portal.pcm.Description" value="Layout displaying one full-width column"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="light_fullWidth.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConF"/>
</property>
</component-profile>
</component>
<component name="narrowWide">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="2 Columns (Narrow:Wide)"/>
<property name="com.sap.portal.pcm.Description" value="Two-column layout displaying the narrow column on the left"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TagLibHtmlb" value="/SERVICE/com.sap.portal.htmlb/taglib/htmlb.tld "/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="narrowWide.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConL"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="column2">
<property name="plainDescription" value="Column 2"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConR"/>
</property>
</component-profile>
</component>
<component name="light_narrowWide">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="EPCFLevel" value="0"/>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="Light 2 Columns (Narrow:Wide)"/>
<property name="com.sap.portal.pcm.Description" value="Two-column layout displaying the narrow column on the left"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="light_narrowWide.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConL"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="column2">
<property name="plainDescription" value="Column 2"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConR"/>
</property>
</component-profile>
</component>
<component name="wideNarrow">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="2 Columns (Wide:Narrow)"/>
<property name="com.sap.portal.pcm.Description" value="Two-column layout displaying the narrow column on the right"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TagLibHtmlb" value="/SERVICE/com.sap.portal.htmlb/taglib/htmlb.tld "/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="wideNarrow.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConL"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="column2">
<property name="plainDescription" value="Column 2"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConR"/>
</property>
</component-profile>
</component>
<component name="light_wideNarrow">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="EPCFLevel" value="0"/>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="Light 2 Columns (Wide:Narrow)"/>
<property name="com.sap.portal.pcm.Description" value="Two-column layout displaying the narrow column on the right"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="light_wideNarrow.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConL"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="column2">
<property name="plainDescription" value="Column 2"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConR"/>
</property>
</component-profile>
</component>
<component name="equalWidths">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="2 Columns (Equal Widths)"/>
<property name="com.sap.portal.pcm.Description" value="Layout displaying two equal-width columns"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TagLibHtmlb" value="/SERVICE/com.sap.portal.htmlb/taglib/htmlb.tld "/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="equalWidths.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConL"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="column2">
<property name="plainDescription" value="Column 2"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConR"/>
</property>
</component-profile>
</component>
<component name="light_equalWidths">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="EPCFLevel" value="0"/>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="Light 2 Columns (Equal Widths)"/>
<property name="com.sap.portal.pcm.Description" value="Layout displaying two equal-width columns"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="light_equalWidths.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConL"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="column2">
<property name="plainDescription" value="Column 2"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConR"/>
</property>
</component-profile>
</component>
<component name="narrowWideNarrow">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="3 Columns (Narrow:Wide:Narrow)"/>
<property name="com.sap.portal.pcm.Description" value="Three columns displayed in a narrow:wide:narrow layout"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TagLibHtmlb" value="/SERVICE/com.sap.portal.htmlb/taglib/htmlb.tld "/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="narrowWideNarrow.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConL"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="column2">
<property name="plainDescription" value="Column 2"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConM"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont3" value="column3">
<property name="plainDescription" value="Column 3"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConR"/>
</property>
</component-profile>
</component>
<component name="light_narrowWideNarrow">
<component-config>
<property name="ClassName" value="com.sapportals.portal.pb.layout.PageLayout"/>
<property name="ResourceBundleName" value="pagebuilder_nls"/>
<property name="SafetyLevel" value="no_safety"/>
</component-config>
<component-profile>
<property name="EPCFLevel" value="0"/>
<property name="ComponentType" value="com.sapportals.portal.layout"/>
<property name="com.sap.portal.pcm.Title" value="Light 3 Columns (Narrow:Wide:Narrow)"/>
<property name="com.sap.portal.pcm.Description" value="Three columns displayed in a narrow:wide:narrow layout"/>
<property name="com.sap.portal.reserved.layout.TagLibLayout" value="/SERVICE/com.sap.portal.pagebuilder/taglib/layout.tld"/>
<property name="com.sap.portal.reserved.layout.TemplateFile" value="light_narrowWideNarrow.jsp"/>
<property name="AuthScheme" value="anonymous"/>
<property name="com.sap.portal.reserved.layout.Cont1" value="column1">
<property name="plainDescription" value="Column 1"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConL"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont2" value="column2">
<property name="plainDescription" value="Column 2"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConM"/>
</property>
<property name="com.sap.portal.reserved.layout.Cont3" value="column3">
<property name="plainDescription" value="Column 3"/>
<property name="orientation" value="vertical"/>
<property name="designClass" value="prtlPageConR"/>
</property>
</component-profile>
</component>
</components>
<services/>
</application>
Greetings,
Praveen Gudapati -
How do you find the average value of all the data between two points on a single channel
I am tring to calculate the average value of all the data points on a single plot between two seperate points
I have attahced an illustration.
Tim
Solved!
Go to Solution.
Attachments:
plot.jpg 173 KBHey smoothdurban,
I've seen Brad's code, and trust me, it's worth the effort to let him help you get it up and running - it's definitely the most ideal way to solve this problem. However, as Brad said, there are multiple ways to tackle this - both interactive and programmatic - so in the meantime, I'll take a second to detail one of the interactive and sure-fire ways to find the average of data between two points on a single channel.
We'll use"Flags." Set up your VIEW graph exactly as you did on your original screenshot, using Band Cursors to approximate the beginning and ending X-values representing the range you want to examine. Next:
1. Click the "Set Flags" button () that is a part of your 2D Axis System. Note that you can hold down the Shift button if you ever decide you want to do this on more than a single curve at one time.
2. Select the "Flags: Copy Data Points" button that enables after Flags are set.
3. This creates new channel(s) in the default (bold) group in the Data Portal that contains only the Flagged data.
4. Select DIAdem ANALYSIS.
5. Select Statistics » Descriptive Statistics.
6. In the Channels input, select the newly created channel containing your Flagged Y-Data.
7. Ensure that the Arithmetic Mean parameter is set. You can preview the data and the result in the dialog before pressing OK to execute the calculation.
You may have noticed that in the Descriptive Statistics calculation, one of the parameters that you can set is the range of channel rows to operate on - so, if you know the row numbers of your beginning and ending X-values, you could just simply run the Descriptive Statistics calculation and use this parameter to operate on a row subset of your original channel instead of the entire channel.
Derrick S.
Product Manager
NI DIAdem
National Instruments -
Concat rows values into single column
Hi All,
How can I concat values of a multiple rows into a single column by separating them by comma.
Eg:
SELECT empno FROM emp;
empno
1
2
3
4
I want output should be:
Empnos
1,2,3,4
Thanks & Regards,
DanishMichaelS wrote:
Or
SQL> select rtrim(xmlagg(xmlelement(e, empno || ',')).extract('//text()').extract('//text()') ,',') empnos from emp
EMPNOS
7369,7499,7521,7566,7654,7698,7782,7788,7839,7844,7876,7900,7902,7934
Hi Michael,
is it an error or is it correct to put extract 2 times? This is giving to me the same result:
select rtrim(xmlagg(xmlelement(e, empno || ',')).extract('//text()'),',') empnos from emp;
EMPNOS
7369,7499,7521,7566,7654,7698,7782,7788,7839,7844,7876,7900,7902,7934 Regards.
Al -
JTabbedPane with two rows of tabs
Hi,
I need to create a JTabbedPane with layout policy as SCROLL_TAB_LAYOUT with two rows of tabs. The first level will have say 10 tabs and the all the remaining tabs (say 20) will be added in the next level. Please help me out on this, to how to proceed with it?
Edited by: Soundarapandian on Nov 25, 2009 3:10 PMSoundarapandian wrote:
I need to create a JTabbedPane with layout policy as SCROLL_TAB_LAYOUT with two rows of tabs. The first level will have say 10 tabs and the all the remaining tabs (say 20) will be added in the next level. Please help me out on this, to how to proceed with it?Try this (imho better) approach:
create a new tabbedpane for each level and add each of these tabbedpanes to an upperlevel tabbedpane, thus allowing you to pre-select the desired level. -
Compare column data of two rows
Hi there,
I a have a table
COMP_ID PROD COLOR COMPAREFLAG ORDER_NUMBER
1 sun red - 2
2 sun blue Y 2
3 horse black - 1
4 horse white Y 1
5 chair black - 3
6 chair black Y 3I would like to compare for example the columns PROD and COLOR of two rows with ORDER_NUMBER = 2
The row with COMP_ID = 1 is the first entry and with COMP_ID = 2 the second one therefore the COMPAREFLAG is set to 'Y'.
If the entries are diffrent both rows should be return to output.
I would like to compare also the rows with COMP_ID 5 and 6. In this case nothing should be return to output.
I don't know how to manage this. Can anyone please help me?
Thanks,
ben
Message was edited by:
ben512I hope that I well understand.
Do you want to get rows only if PROD/COLOR of one row is different of the PROD/COLOR from other row (with the same order_number) ?
What you can try :
SQL> with tbl as
2 (select 1 comp_id, 'sun' prod, 'red' color, null compareflag, 2 order_number from dual union all
3 select 2 comp_id, 'sun' prod, 'blue' color, 'Y' compareflag, 2 order_number from dual union all
4 select 3 comp_id, 'horse' prod, 'black' color, null compareflag, 1 order_number from dual union all
5 select 4 comp_id, 'horse' prod, 'white' color, 'Y' compareflag, 1 order_number from dual union all
6 select 5 comp_id, 'chair' prod, 'black' color, null compareflag, 3 order_number from dual union all
7 select 6 comp_id, 'chair' prod, 'black' color, 'Y' compareflag, 3 order_number from dual )
8 select comp_id, prod, color, compareflag, order_number
9 from (select comp_id,
10 prod,
11 decode(first_value(prod) over (partition by order_number order by comp_id range between unbounded preceding and unbounded following),
12 last_value(prod) over (partition by order_number order by comp_id range between unbounded preceding and unbounded following),null,prod) prod_d,
13 color,
14 decode(first_value(color) over (partition by order_number order by comp_id range between unbounded preceding and unbounded following),
15 last_value(color) over (partition by order_number order by comp_id range between unbounded preceding and unbounded following),null,color) color_d,
16 compareflag,
17 order_number
18 from tbl
19 where order_number=&order_number)
20 where (prod_d is not null or color_d is not null)
21 order by 1;
Enter value for order_number: 1
old 19: where order_number=&order_number)
new 19: where order_number=1)
COMP_ID PROD COLOR C ORDER_NUMBER
3 horse black 1
4 horse white Y 1
SQL> /
Enter value for order_number: 2
old 19: where order_number=&order_number)
new 19: where order_number=2)
COMP_ID PROD COLOR C ORDER_NUMBER
1 sun red 2
2 sun blue Y 2
SQL> /
Enter value for order_number: 3
old 19: where order_number=&order_number)
new 19: where order_number=3)
no rows selected
SQL> Nicolas. -
Copy data of two rows together into a new row
Hello everyone.
I have a question about copying data of two existing rows together into a new third row.
See this short example:
This is the current situation. The rows STATE_1 and STATE_2 contain different separated information.
In the past data were saved randomly in one of those rows.
This is the table State:
ID
Cust_ID
STATE_1
STATE_2
STATE_3
1
88
Customer is waiting.
Call from yesterday.
2
11
Mr. Smith, no answer.
Waiting until December
3
11
Pls create PO.
Old PO was cancelled
4
5
No access to system.
From now on everything has to be saved to the empty STATE_3 but I also need the old entries from the past which also have to be copied together into STATE_3
like this:
ID
Cust_ID
STATE_1
STATE_2
STATE_3
1
88
Customer is waiting.
Call from yesterday.
Customer is waiting. Call from yesterday
2
11
Mr. Smith, no answer.
Waiting until December.
Mr. Smith, no answer. Waiting until December.
3
11
Pls create PO.
Old PO was cancelled.
Pls create PO. Old PO was cancelled.
4
5
No access to system.
No access to system.
Is there an easy SQL-command?
Thanks for any help.Hi,
DB2000 wrote:
Hello everyone.
I have a question about copying data of two existing rows together into a new third row.
See this short example:
This is the current situation. The rows STATE_1 and STATE_2 contain different separated information.
In the past data were saved randomly in one of those rows.
This is the table State:
ID
Cust_ID
STATE_1
STATE_2
STATE_3
1
88
Customer is waiting.
Call from yesterday.
2
11
Mr. Smith, no answer.
Waiting until December
3
11
Pls create PO.
Old PO was cancelled
4
5
No access to system.
When you say "row", do you mean "column"?
DB2000 wrote:
Because in this case STATE_1 and STATE_2 are only text of a log file/history.
So I think 1NF isn't really violated and because of performance of the database in this case it's better to put obsolete rows together.
Why do you think that?
The definition of First Normal Form is that every column of every row contains 1 piece of information, not a variable number of pieces. Whether or not that data is only text of a log file/history has nothing to do with it.
You might claim you have good reasons (such as performance) for violating First Normal form, but you can't say that you're not violating it. -
Fetch Multiple row in repor to insert data with multiple rows .
Hi Friends
i want to Insert emp attendance .
There are 10 emp in company .they enter there arival time in attendance register .
i have two item
1--p1_att_date
2--p1_status
ATTEN_STATUS are PRESENT by default in selectlist .
i want, when i enter date in p1_att_date item and Press submit then generate a report with 10 employee and insert in_time in report and when press enter then data with 10 emp should insert in to table ABC .
i don't want to use tabularform for this .actully i don't want to use ADD_ROW option to ADD attendance for second emp.so please give me some solution.
Emp_ID ATTEN_DATE ATTEN_STATUS IN_TIME OUT_TIME
101 22-JAN-2009 PRESENT
102 22-JAN-2009 PRESENT
103 22-JAN-2009 PRESENT
104 22-JAN-2009 PRESENT
105 22-JAN-2009 PRESENT
106 22-JAN-2009 PRESENT
107 22-JAN-2009 PRESENT
108 22-JAN-2009 PRESENT
109 22-JAN-2009 PRESENT
110 22-JAN-2009 PRESENT
My table is :-
table Name --ABC
emp_id number;
atten_date date;
atten_status varchar2(12);
in_time timestemp;
out_time timestemp;
How can i do this.
Thanks
ManojHi Manoj,
You can create multiple records easily using a single, simple, form. However, you would surely have to enter in the times individually using a tabular form (otherwise, you would have to use the same form 10 times). You do not have to keep the Add Row option on the page - this functionality can be removed.
Andy -
Creating two rows from a single row information
Hi,
I have data that will always be returned as a single row from a join of tables t1, t2.
However I want the single row to be split into two rows. i.e First row containing some fields and second row containing th remaining fields.
I think there might be a thread already existing. Can you please point me in the right direction if it is.
select t1.c1, t1.c2, t2.c1, t2.c2
from t1, t2
where t1.c3 = t2.c3
I expect the output 2 rows like the following
t1.c1 t2.c1
t1.c2 t2.c2
ThanksSQL>WITH t1 AS (SELECT 't1c1_' || ROWNUM AS c1, 't1c2_' || ROWNUM AS c2, ROWNUM AS c3
2 FROM DUAL
3 CONNECT BY LEVEL <= 3),
4 t2 AS (SELECT 't2c1_' || ROWNUM AS c1, 't2c2_' || ROWNUM AS c2, ROWNUM AS c3
5 FROM DUAL
6 CONNECT BY LEVEL <= 3),
7 t3 AS (SELECT t1.c1 AS c11, t1.c2 AS c12, t2.c1 AS c21, t2.c2 AS c22, ROWNUM AS r
8 FROM t1, t2
9 WHERE t1.c3 = t2.c3)
10 SELECT a, b
11 FROM (SELECT c11 AS a, c21 AS b, r, 1 AS s
12 FROM t3
13 UNION ALL
14 SELECT c12, c22, r, 2 AS s
15 FROM t3)
16 ORDER BY r, s;
A B
t1c1_1 t2c1_1
t1c2_1 t2c2_1
t1c1_2 t2c1_2
t1c2_2 t2c2_2
t1c1_3 t2c1_3
t1c2_3 t2c2_3Urs -
Subtracting two rows from the same column
Hi,
I have the following table with about 6000 rows of different year_month but I am compare and subtract v
Organization Year_month Contribution
Kano JAN-2011 200000
KADUNA JAN-2011 300000
ABUJA JAN-2011 400000
Kano FEB-2011 300000
KADUNA FEB-2011 200000
ABUJA FEB-2012 600000
I want to select a year_month at run time to subtract the contribution of the first year_month from the contribution of the second year_month and give me the result as shown in the following table
Organization JAN-2011 FEB-2011 diffrence
Kano 200000 300000 -100000
KADUNA 300000 200000 100000
ABUJA 400000 600000 -200000
Here is my code returning too many va
create or replace function "GET_MONTHLY_VALUE"
(q_name in VARCHAR2,
hmoCode in VARCHAR2)
return VARCHAR2
is
c1 number;
begin
select NHIS_CONTRIBUTION into c1 from CONTRIBUTION_MGT where upper(YEAR_MONTH)=upper(q_name) and upper(ORGANIZATION)=upper(hmoCode);
return c1;
exception when NO_DATA_FOUND THEN
return null;
end;
------a call to the above function:
create or replace function process_cont_monthly return varchar
is
Cursor cont_cursor is select ORGANIZATION from CONTRIBUTION_MGT;
begin
for
cont_rec in cont_cursor loop
select GET_MONTHLY_VALUE(:p26_month,cont_rec.ORGANIZATION) first, GET_MONTHLY_VALUE(:p26_month2,cont_rec.ORGANIZATION) second,
abs(GET_MONTHLY_VALUE(:p26_month,cont_rec.ORGANIZATION)-GET_MONTHLY_VALUE(:p26_month2,cont_rec.ORGANIZATION)) Diffrence
from CONTRIBUTION_MGT;
end loop;
commit;
end;
I became totally confused and don’t know what to do next
Any help and better guide is appreciatedHi,
Here's one way:
WITH months_wanted AS
SELECT 1 AS col, TO_DATE ('JAN-2011', 'MON-YYYY') AS month FROM dual
UNION ALL
SELECT 2 AS col, TO_DATE ('FEB-2011', 'MON-YYYY') AS month FROM dual
, pivoted_data AS
SELECT c.organization
, NVL (SUM (CASE WHEN m.col = 1 THEN c.contribution END), 0) AS total_1
, NVL (SUM (CASE WHEN m.col = 2 THEN c.contribution END), 0) AS total_2
FROM months_wanted m
JOIN contribution_mgt c ON c.year_month >= m.month
AND c.year_month < ADD_MONTHS (m.month, 1)
SELECT organization
, total_1
, total_2
, total_1 - total_2 AS difference
FROM pivoted_data
ORDER BY organization
;I assume that the year_month column is a DATE. Date information always belongs in DATE columns.
As written, the two months do not need to be consecutive. If you always want consectuive months, this can be re-written so that you only have to enter the first month, not both of them.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Point out a few places where the query above is giving the wrong results, and explain, using specific examples, how you get those results from that data in those places. If you changed the query at all, post your code.
Always say which version of Oracle you're using.
See the forum FAQ {message:id=9360002}
Maybe you are looking for
-
How do I get .jpg extension to show in the name of my imported photos?
How do I get .jpg extension to show in the name of my imported photos?
-
Migration from 9.2.0.3 to 11.x
Hi all, First of all, sorry for this already discussed question, I know there are several similar topics. But this is very urgent. Our company needs to migrate from 9.2.0.3 to 11.1.1.3 Now there are installed the next components (9.2.0.3): Shared Ser
-
Hi in our requirement we want to send error response like authentication failed, pwd expired,authentication successful so that portal can get this response and display appropriate custom message to user.How can i send this response through OAM to por
-
Mimic Database/Server crash
Guys, What is the best way to mimic Database/Server crash to test the backup and recovery strategy? Thanks
-
Firefox hangings and stop running after a new upgrade
I really dunno what is going wrong wt my firefox it was working fine before the new upgrade. What happen is despite uninstalling and reinstalling it, firefox browser still hangs while it loads , i simply couldn't do anything at all here. == This happ