Hierarchy table Query..suggestions plz.
Experts,
Find my query below for extracting the level 8 elements from a hierarchy table.
Please suggest a better SQL Query,if there could be one.
SELECT DSEND_ID
FROM PROD WHERE DSEND_LVL=8
AND PARNT_ID IN
(SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=7
AND PARNT_ID IN
(SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=6
AND PARNT_ID IN
(SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=5
AND PARNT_ID IN
(SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=4
AND PARNT_ID IN
(SELECT DSEND_ID FROM PROD WHERE DSEND_LVL=3 AND PARNT_ID='000000080')))))
ORDER BY DSEND_IDThanks,
Bhagat
PARNT_ID DSEND_ID DSEND_LVL PARNT_LVL
000000000 000000000 1 1
PARNT_ID DSEND_ID DSEND_LVL PARNT_LVL
000000000 000000002 2 1
000000002 000000002 2 2
000000000 000000003 2 1
000000003 000000003 2 2
000000000 000000004 2 1
000000004 000000004 2 2
000000000 000000005 2 1
000000005 000000005 2 2
000000000 000000009 2 1
000000009 000000009 2 2
000000000 000000010 2 1
000000010 000000010 2 2
000000000 000000011 2 1
000000011 000000011 2 2
000000000 000000001 2 1
000000001 000000001 2 2
000000000 000000006 2 1
000000006 000000006 2 2
000000000 000000008 2 1
000000008 000000008 2 2
[\pre]
This is how the table data looks...I've put the level 1 and level 2 elements alone..
Similar Messages
-
Update Query For Hierarchy Table
Hi All
I have a Hierarchy table that has news categories. I want use a query than when user deactivate a category, all child category has been deactivated. For example
1- Politics
1-1- National Politics
1-2- International Politics
1-2-1- Asia
1-2-2- Africa
2- Economic
If Politics has been deactivated, all child must be deactivate. (1-1, 1-2, 1-2-1, 1-2-2)
Please help me
With Best RegardsThis is table structure script:
SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE id=OBJECT_ID('tempdb..#tmpErrors')) DROP TABLE #tmpErrors
GO
CREATE TABLE #tmpErrors (Error int)
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
BEGIN TRANSACTION
GO
PRINT N'Creating schemata'
GO
PRINT N'Creating [dbo].[Modules]'
GO
CREATE TABLE [dbo].[Modules]
[Module_ID] [int] NOT NULL,
[ModuleName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ModuleTitle] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Status] [int] NULL
GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
PRINT N'Creating primary key [PK_Modules] on [dbo].[Modules]'
GO
ALTER TABLE [dbo].[Modules] ADD CONSTRAINT [PK_Modules] PRIMARY KEY CLUSTERED ([Module_ID])
GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
PRINT N'Creating [dbo].[Categories]'
GO
CREATE TABLE [dbo].[Categories]
[Category_ID] [int] NOT NULL IDENTITY(1, 1),
[Module_ID] [int] NOT NULL,
[ParentID] [int] NULL,
[Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Title] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Priority] [int] NULL,
[ThumbnailImage] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Status] [int] NULL
GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
PRINT N'Creating primary key [PK_Categories] on [dbo].[Categories]'
GO
ALTER TABLE [dbo].[Categories] ADD CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED ([Category_ID])
GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
PRINT N'Adding foreign keys to [dbo].[Categories]'
GO
ALTER TABLE [dbo].[Categories] ADD CONSTRAINT [FK_Categories_Modules] FOREIGN KEY ([Module_ID]) REFERENCES [dbo].[Modules] ([Module_ID])
GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
IF EXISTS (SELECT * FROM #tmpErrors) ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT>0 BEGIN
PRINT 'The database update succeeded'
COMMIT TRANSACTION
END
ELSE PRINT 'The database update failed'
GO
DROP TABLE #tmpErrors
GO
This is table data
SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS, NOCOUNT ON
GO
SET DATEFORMAT YMD
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
BEGIN TRANSACTION
-- Pointer used for text / image updates. This might not be needed, but is declared here just in case
DECLARE @pv binary(16)
PRINT(N'Drop constraints from [dbo].[Categories]')
GO
ALTER TABLE [dbo].[Categories] DROP CONSTRAINT [FK_Categories_Modules]
PRINT(N'Add 14 rows to [dbo].[Categories]')
GO
SET IDENTITY_INSERT [dbo].[Categories] ON
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (1, 1, NULL, 'News', N'اخبار', 1, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (2, 2, NULL, 'Article', N'مقالات', 2, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (3, 3, NULL, 'Galleries', N'گالری', 3, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (4, 1, 1, 'Politics', N'سیاسی', 1, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (5, 1, 1, 'Economic', N'اقتصادی', 2, '', 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (6, 1, 4, 'NationalPilitics', N'سیاست داخلی', 1, '', 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (7, 1, 4, 'InternationalPolitics', N'سیاست خارجی', 2, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (8, 1, 7, 'Asia', N'آسیا', 1, '', 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (9, 1, 7, 'Europe', N'اروپا', 2, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (10, 1, 7, 'Africa', N'آفریقا', 3, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (11, 2, 2, 'Scientic', N'علمی', 1, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (12, 2, 2, 'Art', N'هنری', 2, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (13, 3, 3, 'Culture', N'فرهنگی', 1, NULL, 1)
INSERT INTO [dbo].[Categories] ([Category_ID], [Module_ID], [ParentID], [Name], [Title], [Priority], [ThumbnailImage], [Status]) VALUES (14, 3, 3, 'Religion', N'مذهبی', 2, NULL, 1)
SET IDENTITY_INSERT [dbo].[Categories] OFF
PRINT(N'Add constraints to [dbo].[Categories]')
GO
ALTER TABLE [dbo].[Categories] ADD CONSTRAINT [FK_Categories_Modules] FOREIGN KEY ([Module_ID]) REFERENCES [dbo].[Modules] ([Module_ID])
COMMIT TRANSACTION
GO
Thanks for your help -
Duplicate rows in Hierarchy Table created when running incremental load
I copied an out of the box dimension and hierarchy mapping to my custom folders (task hierarchy) this should create the same wids from dimension to hierarchy table and on full load does this using the sequence generator. The problem I am getting is whenever I run a incremental load instead of updating, a new record is created. What would be the best place to start looking at this and testing. A full load runs with no issues. I have also checked the DAC and run the SDE trunc always and SIL trunc for full load only.
Help appreciatedProvide the query used for populating the child records. Issue might be due to caching.
Thanks
Shree -
Creating a Hierarchy Viewer query
Hello,
I'm having huge difficulties creating a Hierarchy Viewer Query. I've looked through the source code contained withing the demo, but it seems to require great knowledge regarding the component. I'm using a three-node model, each node grouped within it's parent.
So I created a custom View to be used as a result list for the query and this part is working just fine. I can pick the unique ID for the node I want from the search results when the user selects one, but I don't know how I can make that specific node my "anchor", my "current node", after that.
Since I'm looking for a specific "contact_id" selected from the search results, I think the correct way of doing it is finding it's node on the TreeModel, and then setting it as my current anchor.
Please, any tips, directions or suggestions on how can I go about doing this?
Thanks!!Hi!
Thanks for the attention, but I've been through all the basic stuff. The HV documentation only teaches the most primitive part of it. I searched all blogs related to HV, all articles I could find, I've meddled with the demo source code and all I can think of, but I couldn't find anyone who would give much insight on the mechanics of the component or how to build a really powerful search engine for it.
As a sugestion for the developer team, it would be great if the query for this component allowed us to specify actions to be performed on all levels of the tree, instead of only the root node, since most of the time people use HV as a multi-root tree. -
Group matrix report with an hierarchy table???
Hello,
I have a big trouble making up a report involving many tables and one of them having a many-to-many recursive relationship. The user has a defined request in having the information grouped.I'll give some more details. I would like to know if you have any ideas in how to structure the report..
Here are the tables:
ORG
(org_id not null,
org_name not null)
DNR
(dnr_id not null,
org_id not null,
dnr_age,
dnr_gender)
CS
(cs_id not null,
dnr_id not null)
Smpl
(smpl_id not null,
dnr_id notnull,
org_id,
smpl_tp not null,
cs_id,
meth,
notes)
Tr_map
(tr_id not null,
smpl_prnt not null,
smpl_chld,
pos)
Some data..
Smpl_id Dnr_id Org_id Smpl_tp Cs_id Meth Notes
107 101 137 tss a xxxx
118 112 137 tss ab xxxx
122 108 25 tss 3768 a xxxx
123 108 25 tss 3768 ab xxxx
124 108 25 blk c yyyy
125 108 25 sld d zzzz
126 108 25 blk c yyyy
tr_id Smpl_prnt Smpl_chld Pos
1 107
2 118
3 122
4 123
5 124 122 1
7 125 124 1
8 126 122 1
10 125 126 2
The user wants the data reported as follows:
Org name
Dnr_id, dnr_age etc...
Cs_id
Smpl_id, Smpl_tp (tss), Meth, Notes
Smpl_id,smpl_tp(blk), Meth, Notes ...
Smpl_id, smpl_tp(sld), Meth, Notes...
Cs_id
Smpl_id, Smpl_tp (tss), Meth, Notes
Smpl_id, smpl_tp(blk), Meth,Notes...
Smpl_id, smpl_tp(sld), Meth, Notes...
I think the grouped matrix would be the solution but I don't know how to do that with the hierarchy table to show the children and grandchildren as subgroups. Is that possible in a single query? How can I build a group matrix with multiple subgroups?
Thanks in advance.
simona
nullThe example given by Oracle (from the above link) using the following SQL for a matrix report is flawed.
SELECT DEPTNO, JOB, SUM(SAL)
FROM EMP
GROUP BY DEPTNO, JOB
ORDER BY DEPTNO, JOB
The SUM function handled by the query restricts you from doing so many things - especially when you want the empty fields to be filled by 0 (by using the Value if Null property).
If the query is changed to ''SELECT DEPTNO, JOB, SAL FROM EMP' , and use the SUM function in the wizard to build the Matrix cell, then the 'Value if Null' property can be used without any issues.
This also makes Section 25.6 (Add zeroes in place of blanks) of the documentation a joke.
Anyway, that's my cents worth.... -
SQL+-MULTI TABLE QUERY PROBLEM
HAI ALL,
ANY SUGGESTION PLEASE?
SUB: SQL+-MULTI TABLE QUERY PROBLEM
SQL+ QUERY GIVEN:
SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
DLC_POLYMORPHS_NORMAL_VALUE FROM PATIENTS_MASTER1, HAEMATOLOGY1,
DIFFERENTIAL_LEUCOCYTE_COUNT1
WHERE PATIENT_NUM = HMTLY_PATIENT_NUM AND PATIENT_NUM = DLC_PATIENT_NUM AND PATIENT_NUM
= &PATIENT_NUM;
RESULT GOT:
&PATIENT_NUM =1
no rows selected
&PATIENT_NUM=2
no rows selected
&PATIENT_NUM=3
PATIENT_NUM 3
PATIENT_NAME KKKK
HMTLY_TEST_NAME HAEMATOLOGY
HMTLY_RBC_VALUE 4
HMTLY_RBC_NORMAL 4.6-6.0
DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
DLC_POLYMORPHS_VALUE 60
DLC_POLYMORPHS_NORMAL_VALUE 40-65
ACTUAL WILL BE:
&PATIENT_NUM=1
PATIENT_NUM 1
PATIENT_NAME BBBB
HMTLY_TEST_NAME HAEMATOLOGY
HMTLY_RBC_VALUE 5
HMTLY_RBC_NORMAL 4.6-6.0
&PATIENT_NUM=2
PATIENT_NUM 2
PATIENT_NAME GGGG
DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
DLC_POLYMORPHS_VALUE 42
DLC_POLYMORPHS_NORMAL_VALUE 40-65
&PATIENT_NUM=3
PATIENT_NUM 3
PATIENT_NAME KKKK
HMTLY_TEST_NAME HAEMATOLOGY
HMTLY_RBC_VALUE 4
HMTLY_RBC_NORMAL 4.6-6.0
DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
DLC_POLYMORPHS_VALUE 60
DLC_POLYMORPHS_NORMAL_VALUE 40-65
4 TABLES FOR CLINICAL LAB FOR INPUT DATA AND GET REPORT ONLY FOR TESTS MADE FOR PARTICULAR
PATIENT.
TABLE1:PATIENTS_MASTER1
COLUMNS:PATIENT_NUM, PATIENT_NAME,
VALUES:
PATIENT_NUM
1
2
3
4
PATIENT_NAME
BBBB
GGGG
KKKK
PPPP
TABLE2:TESTS_MASTER1
COLUMNS:TEST_NUM, TEST_NAME
VALUES:
TEST_NUM
1
2
TEST_NAME
HAEMATOLOGY
DIFFERENTIAL LEUCOCYTE COUNT
TABLE3:HAEMATOLOGY1
COLUMNS:
HMTLY_NUM,HMTLY_PATIENT_NUM,HMTLY_TEST_NAME,HMTLY_RBC_VALUE,HMTLY_RBC_NORMAL_VALUE
VALUES:
HMTLY_NUM
1
2
HMTLY_PATIENT_NUM
1
3
MTLY_TEST_NAME
HAEMATOLOGY
HAEMATOLOGY
HMTLY_RBC_VALUE
5
4
HMTLY_RBC_NORMAL_VALUE
4.6-6.0
4.6-6.0
TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
COLUMNS:DLC_NUM,DLC_PATIENT_NUM,DLC_TEST_NAME,DLC_POLYMORPHS_VALUE,DLC_POLYMORPHS_
NORMAL_VALUE,
VALUES:
DLC_NUM
1
2
DLC_PATIENT_NUM
2
3
DLC_TEST_NAME
DIFFERENTIAL LEUCOCYTE COUNT
DIFFERENTIAL LEUCOCYTE COUNT
DLC_POLYMORPHS_VALUE
42
60
DLC_POLYMORPHS_NORMAL_VALUE
40-65
40-65
THANKS
RCS
E-MAIL:[email protected]
--------I think you want an OUTER JOIN
SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
DLC_POLYMORPHS_NORMAL_VALUE
FROM PATIENTS_MASTER1, HAEMATOLOGY1, DIFFERENTIAL_LEUCOCYTE_COUNT1
WHERE PATIENT_NUM = HMTLY_PATIENT_NUM (+)
AND PATIENT_NUM = DLC_PATIENT_NUM (+)
AND PATIENT_NUM = &PATIENT_NUM;Edited by: shoblock on Nov 5, 2008 12:17 PM
outer join marks became stupid emoticons or something. attempting to fix -
Improve Query Suggestions Load time
How can I improve load time for Pre Query Suggestions on search home page when user start typing ??
I notice it was slow in loading when I hit first time in the morning so I try to warm up by adding
""http://SiteName/_api/search/suggest?querytext='sharepoint' ""
in to warm up script but even during the day time after hitting few times it is slower some times . Any reason ?
Do you think moving Query Component to WFE will do any help here?
Pleas let me know - Thanks .Hi,
Query Suggestions should work at a high level overview is:
• You issue a query within a Search Center site and get results..
• When you hover over or click a result.. this gets stored as a “RecordPageClick” method and will be stored in the Web Applications W3WP process…
• Every five minutes ( I believe ) this W3WP will flush these Recorded Page Clicks and pass them over to the Search Proxy…
• This will then store them in a table in the SSA ( Search Service Application ) Admin DB
• By default, once a day, there is a timer job, Prepare Query Suggestions, that will run
• It does a check to see if the same term has been queried for and clicked at least 6 times and then will move them to another table in the same DB..
• If there are successful queries\clicks > 6 times for a term, and they move to the appropriate table, then when you start to type a word, like “share”
• This will fire a “method” over to the Search proxy servers called “GetQuerySuggestions” and will check that Admin DB to see if they have any matches..
• If so, then it will show up in your Search Box as like “SharePoint” for a suggestion…
Other components involved with the Query Suggestions:
Timer Jobs
Prepare query suggestions Daily
Query Classification Dictionary Update for Search Application Search Service Application Minutes
Query Logging Minutes
Database
MSSQLogQuerySuggestion (SearchDB) This gets cleaned up when we run the timer job
MSSQLogQueryString (SearchDB) Info on the Query String
MSSQLogSearchCounts (SearchDB) Info on the click counts
MSSQLogQuerySuggestion Looks like this may be where the hits for suggestions are stored
So the issue might related to timer job, database, connection between SharePoint server and SQL server. There is a similar case caused by DistributedCache.
If you move query component on to another sever, this may improve the process related to Search service, however, it may affect the performance due to networking.
Please collect verbose ULS log per steps below:
Enable Verbose logging via Central Admin> Monitoring> Reporting>Configure diagnostic logging(You can simply set all the categories with Verbose level and I can filter myself).
Reproduce the issue(Try to remove SSRS).
Record the time and get a capture of the error message(including the correlation ID if there is). Collect the log file which is by default located in the folder: <C:\Program files\common files\Microsoft Shared\web server extensions\15\LOGS>.
Stop verbose logging.
Regards,
Rebecca Tu
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]. -
Hi all.
A user has requested a hierarchial table display, consisting of header rows and detail rows, both with multiple but different columns.
Something like the old FM REUSE_ALV_HIERSEQ_LIST_DISPLAY.
For example:
Purch. Order Vendor Name
Item Description Material Quantity UoM
3800000001 123456 Widgets R Us
20 Blue Widget WID001 2 EA
20 Red Widget WID002 5 EA
30 Green Widget WID003 4 EA
3800000002 654321 Widget Warehouse
20 Blue Widget WID001 3 EA
I have had a look at Table with Tree (DEMO_TABLE_WITH_TREE), but from what I can see this UI only allows a single column for the hierarchy structure.
Does anyone know how to achieve a multi-column hierarchial display in a table ? Any suggestions or comments appreciated.
Thanks & regards,
GroganHi,
Refer this article: [ALV and Standard Table as Hierarchy in Web Dynpro ABAP|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f].
I hope it helps.
Regards
Arjun -
Hi all,
I have a hierarchy table as below.
HEIR_ID HEIR1_ID HEIR1_NAME HEIR2_ID HEIR2_NAME ... HEIR30_ID HEIR30_NAME
1000 A123 XYZ A123T ABC ... ADF ADF
1000 A123 XYZ A123T ABC ... ADF ADF
1000 A123 XYZ A123F BCD ... MDX MDX
1000 A123 XYZ A123F BCD ... MDX MDX
1000 A123 XYZ A123D PQR ... ADF ADF
1000 A123 XYZ A123D PQR ... ADF ADF
1000 A123 XYZ A123D PQR ... ADF ADF
1000 A123 XYZ A123D PQR ... ADF ADF
1000 B123 ZZZ B123Z YHU ... KOL KOLI need your help to write query which gives hierarchy at column wise, as below.
HEIR_ID HEIR1_ID HEIR1_NAME HEIR2_ID HEIR2_NAME ... HEIR30_ID HEIR30_NAME
1000 A123 XYZ
A123T ABC ADF ADF
ADF ADF
A123F BDC MDX MDX
MDX MDX
A123D PQR ADF ADF
ADF ADF
ADF ADF
ADF ADF
B123 ZZZ
B123Z YHU
KOL KOLCan someone help me which analytical function i need to use to achive this result?/* Formatted on 2012/06/04 16:10 (Formatter Plus v4.8.8) */
WITH t AS
(SELECT 1000 heir_id, 'A123' heir1_id, 'XYZ' heir1_name, 'A123T' heir2_id, 'ABC' heir2_name, 'ADF' heir30_id, 'ADF' heir30_name
FROM DUAL
UNION ALL
SELECT 1000, 'A123', 'XYZ', 'A123T', 'ABC', 'ADF', 'ADF'
FROM DUAL
UNION ALL
SELECT 1000, 'A123', 'XYZ', 'A123F', 'BCD', 'MDX', 'MDX'
FROM DUAL
UNION ALL
SELECT 1000, 'A123', 'XYZ', 'A123F', 'BCD', 'MDX', 'MDX'
FROM DUAL
UNION ALL
SELECT 1000, 'A123', 'XYZ', 'A123D', 'PQR', 'ADF', 'ADF'
FROM DUAL
UNION ALL
SELECT 1000, 'A123', 'XYZ', 'A123D', 'PQR', 'ADF', 'ADF'
FROM DUAL
UNION ALL
SELECT 1000, 'A123', 'XYZ', 'A123D', 'PQR', 'ADF', 'ADF'
FROM DUAL
UNION ALL
SELECT 1000, 'A123', 'XYZ', 'A123D', 'PQR', 'ADF', 'ADF'
FROM DUAL
UNION ALL
SELECT 1000, 'B123', 'ZZZ', 'B123Z', 'YHU', 'KOL', 'KOL'
FROM DUAL),
u AS
(SELECT t.*, ROW_NUMBER () OVER (PARTITION BY heir_id, heir1_id ORDER BY heir_id) rn1,
ROW_NUMBER () OVER (PARTITION BY heir_id, heir1_id, heir2_id ORDER BY heir_id) rn2,
ROW_NUMBER () OVER (PARTITION BY heir_id, heir1_id, heir2_id, heir30_id ORDER BY heir_id) rn3
FROM t)
SELECT DECODE (rn1, 1, heir1_id, NULL) heir_id1, DECODE (rn2, 1, heir2_id, NULL) heir_id2, DECODE (rn3, 1, heir30_id, NULL) heir_id3
FROM uoutput:
HEIR_ID1 HEIR_ID2 HEIR_ID3
A123 A123D ADF
A123F MDX
A123T ADF
B123 B123Z KOL -
How to delete entire data in the hierarchy table,?
hi friends
i need to delete entire data in the hierarchy table which contains parent child relationship,when i am selecting entire records and choose the option delete from the context menu, it is not deleting, and i have to delete one by one or i have delete first the child items and later parents items, it is time consuming process.
Is there any other option to delete entire records in the hierachy table , irrespective of parent and child relationship?
if any one have solution for my issue, please provide to me
thanks in advance
bharat.chinthapatlaHi Bharat,
Unload the Repository and Delete the Table and fields in Hierarchy table and Recreate and reload the data.OIther wise you have to lot of manual work.
Thanks
Ganesh Kotti -
How to retrieve the data from MDM hierarchy table using MDM Java API
Hi,
I had a hierarchy table in MDM. This table had some column say x. I want to retrieve the values of this x column and need to show them in a drop down using MDM Java API.
Can anyone help me to solve this?
Regards
VallabhaneniHi,
Here is your code...
TableId Hier_TId = repository_schema.getTableId(<hierarchy table id>);
java.util.List list = new ArrayList();
ResultDefinition Supporting_result_dfn = null;
FieldProperties[] Hier_Field_props =rep_schema.getTableSchema(Hier_TId).getFields();
LookupFieldProperties lookup_field = null;
TableSchema lookupTableSchema = null;
FieldId[] lookupFieldIDs = null;
for (int i = 0, j = Hier_Field_props.length; i < j; i++) {
if (Hier_Field_props<i>.isLookup()) {
lookup_field = (LookupFieldProperties) Hier_Field_props<i>;
lookupTableSchema =repository_schema.getTableSchema(lookup_field.getLookupTableId());
lookupFieldIDs = lookupTableSchema.getFieldIds();
Supporting_result_dfn = new ResultDefinition(lookup_field.getLookupTableId());
Supporting_result_dfn.setSelectFields(lookupFieldIDs);
list.add(Supporting_result_dfn);
com.sap.mdm.search.Search hier_search =new com.sap.mdm.search.Search(Hier_TId);
ResultDefinition Hier_Resultdfn = new ResultDefinition(Hier_TId);
Hier_Resultdfn.setSelectFields(rep_schema.getTableSchema(Hier_TId).getDisplayFieldIds());
ResultDefinition[] supportingResultDefinitions =
(ResultDefinition[])list.toArray(new ResultDefinition [ list.size() ]);
RetrieveLimitedHierTreeCommand retrieve_Hier_tree_cmd =
new RetrieveLimitedHierTreeCommand(conn_acc);
retrieve_Hier_tree_cmd.setResultDefinition(Hier_Resultdfn);
retrieve_Hier_tree_cmd.setSession(Auth_User_session_cmd.getSession());
retrieve_Hier_tree_cmd.setSearch(hier_search);
retrieve_Hier_tree_cmd.setSupportingResultDefinitions(supportingResultDefinitions);
try {
retrieve_Hier_tree_cmd.execute();
} catch (CommandException e5) {
// TODO Auto-generated catch block
e5.printStackTrace();
HierNode Hier_Node = retrieve_Hier_tree_cmd.getTree();
print(Hier_Node,1);
//method print()
static private void print(HierNode node, int level) {
if (!node.isRoot()) {
for (int i = 0, j = level; i < j; i++) {
System.out.print("\t");
System.out.println(node.getDisplayValue());
HierNode[] children = node.getChildren();
if (children != null) {
level++;
for (int i = 0, j = children.length; i < j; i++) {
print(children<i>, level);
//end method print()
Best regards,
Arun prabhu S
Edited by: Arun Prabhu Sivakumar on Jul 7, 2008 12:19 PM -
Key Mapping in Hierarchy Table
Hi,
I have enabled the Key Mapping = Yes for Hierarchy table. But when I imported the records to the Hierarchy table, I am not seeing any key mapping info for the Hierarchy table records. Any thoughts?. Key mapping does not work for Hierarchy tables?.
Thanks
Job.Hi Job
Key mappings work fine with hierarchy table as well.What was the means of import for hierarchy table. If you have used a excel file and while connecting to Import manager which remote system you selected. If you have used MDM as remote system key mapping will be blank. we need to add the record key mappings. Select all the records in record mode for hierarchy table and edit key mappings.
Also which mode you are ssing the records. This will not come in hierarchy mode, select record mode and check the edit key mapping functionality.
Please award if useful.
Regards
Ravi -
Hierarchy table sort order no longer required in 11.1.1.3?
Hi guys,
I am working on loading Dimensions through EPMA interface tables. Hyperion version 11.1.1.3. The sort order for the records was not in line with the hierarchy. Still the dimension got loaded without any errors. I remember in the older versions we would have to have the records in the hierarchy table in the right order for the metadata to get loaded properly.
Just wanted to confirm if this is a 11.1.13 version enhancement and not something that I am missing.
Thanks.Hi Luc,
I have checked our bug DB, but couldn't find any bug that would explain a change in behavior of processDatabaseChangeNotification() in 11.1.1.3
On the contrary, we have been working on issues related to NPE during its execution recently (fix will be included in JDev 11.1.1.4.0).
Could you create a Service Request in "My Oracle Support" and upload your sample ?
We will have a look.
Regards,
Didier. -
Cannot deactivate hierarchy in Query
Dear all,
From my problem is about activate/deactivate hierarchy for query in SAP BI version 7.0 whether query running on portal or on Business Exploeror(excel).
First of all, this query is reported about cost center value and amount.
I set the user with authorized for responsibled cost center.
This user can access and run this query for responsibled cost center with hierarchy display active without error.
And i see that, this report is filter with the user authorization, that's correct.
But my problem is ...when this user deactivate the hierarchy in the query, the message " User is not authorized" will be showned. It's mean that the auto-filter doesn't work.
How can i set the authorization to user which can deactivate hierarchy and see data only responsible cost center?
Thanks for any help in advance.
Best Regards,
Lavitra P.Thanks for your information.
I have set authorization in authorization object: S_RS_AUTH (the value of this object will be cost center) and authorization is based on hierarchy node.
Moreover, in model, character is flagged as auth-relevant. (if not set as auth-relevant, i think that the cost center will not be check as authorize)
for checking SU53, i already done and the system require S_RS_AUTH with value 0BI_ALL which is the value of root of cost center (highest node). and if i assign this, although i can deactivate hierarchy but all cost center data will be shown ( not only responsible cost center) that user can see data in other cost center so it's not correct way to solve this problem.
Do you have the way to set without auth-check fail? -
How to transform data from hierarchy table to taxonomy table?
Hi Friends
Regarding my issue:
1) I am having data in the hierarchy table which contains two fields(i.e. code, description) , now we have created another taxonomy table which contains two fields(i.e. code,description) same as hierarchy table.
2) hierarchy table only contains data, which we have imported data into hierarchy table using import manager. we don't have data in the taxonomy table.
3) now my issue is,we have to move that hierachical data in the hierarchy table to taxonomy without using import manager, only through the data manager using validations and assignments.
4) If any one have solution to this issue, please help me out.
Thanks in Advance
bharat.chinthapatlaHi Ganesh,
Thanks for your reply,
I need to move data from hierarchy table to taxonomy table using validations and assignments.
Thanks in Advance
bharat.chinthapatla
Maybe you are looking for
-
Hi Experts, I understand that there is a Customizing Switch available for the Budget check in Shopping Cart (SRM_701_BUDGET_CHECK_SC), but i didn't understand the objective of the same. Withouth activation of this switch also the SC checks the budget
-
Seeburger X.400 adapter
Hi Experts, I want material/links on seeburger X.400 adapter, I searched on SDN, but could not find any material for X.400 channel configuration. In our landscape, client is thinking to install the X.400 adapter & so, I want to understand its configu
-
IMovie wont respond after i click "iPhoto Videos"
When i click on "iphoto videos" i get the color wheel, and it just goes indefinitely. I have had it sit their for hours. The only way I can stop it is to force quit. I was thinking there may be an error in the software. I would like to reinstall, or
-
My Ipod (4th gen) is hanging and applications are crashing what to do??
Hanging a lot and the applications are crashing and not able to play subway surfers because of hanging...
-
Data retention limit for infoproviders??
Hello experts Can any budy tell me how to find out data retention limit for all infoproviders?? Thanks Sudeep