Merge data/result sets that are't parent/child?

Hi:
I've seen a few examples of making a data template so that a BI report can have master/detail data. They make a Q1 data set and a Q2 data set with a bind variable to link the two in a parent/child relationship.
But what I need is effectively a UNION. I have the same table on multiple database instances and I want to show the grouped results in one report as if it all came from one table. The master/detail examples have a section defining grouping but they group by Q1 (see here)
http://blogs.oracle.com/BIDeveloper/data_template/
and I need to group by a column that is in Q1 and Q2 to "merge" the two data sets.
Has anyone done this?
Thanks.

I've messed up what I had! lol
I'll try and recreate things tomorrow and get it to you, thanks.
I seem to be having some quirks with all this (or I'm just confused). I initially had a data model that selected a few columns and a count(*) an grouped the results. I modified the data model to not have the count but every time I do "insert table/chart" in RTF the count column shows up as a possible column to move over with >>. I've re-opened the document so it should have the latest data model. Is this normal? A bug? Am I just lost?
Thanks.

Similar Messages

  • Format result-set of join (split parent/child rows)

    Hi,
    I have the need to do a simple join however instead of returning all the columns from both the joined tables in 1 row, we need to have them split into multiple rows (i.e. parent record info on 1 row and child record info on the next)
    e.g. If we have the following data:
    table_1
    id    parent_id
    101    null
    102    null
    103    null
    104    101
    105    101
    106    102
    I need the data as follows:
    id    parent_id    record_type
    101    null        'parent'
    104    101        'child'
    105    101        'child'
    102    null        'parent'
    106    102        'child'
    (note: since 103 did not have any children, it was not returned (as expected & as desired) - also, dont worry about order of results for now)
    This can be achieved this by using the following:
    ;with temp
    as
    select [id],parent_id,[header_1],'parent' as type
    from table1
    temp2 as
    select [id],parent_id,[header_1],'child' as type
    from table1
    select distinct A.*
    from temp A
    join temp2 B on B.parent_id = A.id
    union
    select distinct B.*
    from temp A
    join temp2 B on B.parent_id = A.id
    However, is there any better/more efficient way to get this?
    Appreciate any help on this.

    For future reference, I'll point out that you ask 2 very different questions.  When you ask about "better", you need to define how you measure that quality.  "Better", like "pretty", has no universal measure.  
    Next, you ask about "more efficient".  Well, your example is very simplistic - perhaps to the point of being unreasonably so.  You measure efficiency by examining the query plan - and that requires an actual populated table, with indexes,
    constraints, and data that accurately reflects your data  in both size and distribution of values. If you simplify things too much, you may find that your attempts to improve things lead you down the wrong path.  
    Also, be careful what you assume about your data.  You have conveniently created a set of rows that have a rather natural order.  If you care about the order of your resultset - and generally someone somewhere does - then you need to develop a
    solution that works for all situations and does not implicitly rely on assumptions.  And that requires that you put some thought into choosing your sample/test data.  With that said, below is yet another alternative:
    if object_id('table_1') is not null
    drop table table_1;
    go
    create table table_1 (id int not null constraint pkx primary key, parent_id int null);
    alter table table_1 add constraint fkx foreign key (parent_id) references table_1 (id);
    go
    insert table_1(id, parent_id)
    values (101, null), (102, null), (103, null), (104, 101), (105, 101), (106, 102), (5, 102);
    with cte as (select * from table_1 as src
    where parent_id is not null or
    (parent_id is null and exists (select * from table_1 as chld where chld.parent_id = src.id)))
    select *, case when parent_id is null then 'parent' else 'child' end as record_type from cte
    order by isnull(parent_id, id), case when parent_id is null then 0 else 1 end, id;
    go
    Notice the additional row of data I added where id = 5.   I will also add that you should use "union all" and not "union".  There is no need to force the engine to do work that is not needed.   

  • How can I get missing contacts, notes, calendar dates and reminders that are just on my old iphone onto the iCloud for transfer to my new iPhone upgrade?

    Dear wise & wondeful people:
    How can I get missing contacts, notes, calendar dates and reminders that are just on my old iphone onto the iCloud for transfer to my new iPhone upgrade? Half of my contacts, notes, ect. were on my iCloud so have happily moved to my new iPhone but the rest are completely resistant. For example, on my iCloud I have 14 missing contacts starting with the letter A alone, however they are happily viewable on my old iPhone 4S and won't budge over into the iCloud.
    There are also 3 notes missing yet still acessible on my onld iPhone 4S, the list goes on.
    Your help would be most appreciated. Thank you so much.
    BCHR

    Hi BCHR,
    If you are having issues transfering your content from your old iPhone onto iCloud so it can be transfered to your new iPhone, you may find the following articles helpful:
    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device
    http://support.apple.com/kb/HT2109
    iCloud: Troubleshooting iCloud Contacts
    http://support.apple.com/kb/TS3998
    iCloud: Troubleshooting iCloud Calendar
    http://support.apple.com/kb/TS3999
    iCloud: Notes overview
    http://support.apple.com/kb/PH12081
    Regards,
    - Brenden

  • I listen to a lot of live performances (house sets that are from 1 hour to 3 hours long) when I start to listen to a set and then stop to do something else on the iPhone when I go back to start to listen to the track it has started from the beginning.

    I listen to a lot of live performances (house sets that are from 1 hour to 3 hours long) when I start to listen to a set and then stop to do something else on the iPhone when I go back to start to listen to the track it has started from the beginning.

    It sounds like either your hard drive or the SATA cable that connects it to the motherboard are failing. This could be heat related in your case, which is why you see it after it runs awhile. You can take it to the Genius Bar for a free evaluation. If you decide to test it yourself, I usually suggest moving the hard drive to an external enclosure. If it works there for awhile, the cable is probably the issue.
    http://www.amazon.com/Sabrent-2-5-Inch-Aluminum-Enclosure-EC-TB4P/dp/B005EIGUD4/ ref=sr_1_3?ie=UTF8&qid=1397647657&sr=8-3&keywords=2.5+enclosure
    http://www.ifixit.com/Device/MacBook_Pro_13%22_Unibody_Mid_2009

  • User Exit transaction FB05 with data of documents that are to be cleared.

    Hi,
    Is there any user exit or badi in transaction FB05, where the data of documents that are to be cleared and the data of payment document are available?
    I need that in the F110 transaction, the field SGTXT of the payment document is filled with the field XBLNR of documents to compensate.
    Thanks in advance.
    Regards,
    Ana Lucas

    Hi,
    The field XBLNR of the clearing document isn't the same of cleared document.
    In the substitution we don't have available the data of cleared document,  but only the data of clearing document.
    Regards
    Ana Lucas

  • Query - Cannot Retrieve the Data / Result Set

    Hello,
    I'm trying to query a cube through the OLAP connection using Java and every time I try to execute a query an exception is thrown stating "Cannot retrieve the data set" or "Cannot retrieve the result set" depending on how I'm doing the query.  I've tried to execute the query both through the use of an IBIQuery and IBICommandProcessor object as well as directly through the IBIOlap connection via an MDX statement and both methods produce the same exception.  If anyone can shed some light on why exception is being thrown it would be greatly appreciated.

    please help me ... The question has nothing to do with 'getting' data from excel and certainly not with putting it into MySQL.
    The stack trace specifically tells you that your connection string is wrong.
    It also tells you which connection string is wrong.
    Which you can use to determine specifically which one is wrong. And which you did not provide that info to us.

  • Merging data without set text framing - creating continuous, flowing/wrapping records

    Hi.
    Has anyone figured out a way to merge data without confining each record to set text frame size, hence creating a continuous flow or wrapping of records?
    I need to put in an image, followed by a text description, so I can't merge all the text into one text box.
    I can fit frame to text, then align with set gap, but this is way to time consuming and ineffective when creating a doc of several 100 pages.

    OysterBoy84 wrote:
    Hi.
    Has anyone figured out a way to merge data without confining each record to set text frame size, hence creating a continuous flow or wrapping of records?
    I need to put in an image, followed by a text description, so I can't merge all the text into one text box.
    I can fit frame to text, then align with set gap, but this is way to time consuming and ineffective when creating a doc of several 100 pages.
    Searching Google for "indesign script combine all stories" without quotes turns up a number of links. There's a link to InDesign Secrets that describes a free script that may solve your problem.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • The result set that contain 10 rows always

    Hi all,
    I'm wondering if there is some way to produce the result set of a query in 10 rows always, in other word i run a query and i want that the result set in 10 row even if the query dosn't return any row.
    I need that row as a placeholder.
    thanks
    Francesco

    Happened to be GUI developer and try to take advantage of SQL,
    select * from (select rownum rn, e.* from emp e where rownum<11 and 1=2) e
    right join (select rownum rn from dual connect by rownum<11) t
    on t.rn=e.rn
    RN 
    EMPNO ENAME 
    JOB         
    MGR HIREDATE    
    SAL  
    COMM
    DEPTNO    
    RN
    5
    8
    3
    1
    2
    10
    6
    7
    4
    9
    10 rows selected.
    select * from (select rownum rn, e.* from emp e where rownum<11) e
    right join (select rownum rn from dual connect by rownum<11) t
    on t.rn=e.rn
    RN 
    EMPNO ENAME 
    JOB         
    MGR HIREDATE    
    SAL  
    COMM
    DEPTNO    
    RN
    1  
    7369 SMITH 
    CLERK      
    7902 17-DEC-80   
    800               
    20     
    1
    2  
    7499 ALLEN 
    SALESMAN   
    7698 20-FEB-81  
    1600   
    300    
    30     
    2
    3  
    7521 WARD  
    SALESMAN   
    7698 22-FEB-81  
    1250   
    500    
    30     
    3
    4  
    7566 JONES 
    MANAGER    
    7839 02-APR-81  
    2975               
    20     
    4
    5  
    7654 MARTIN
    SALESMAN   
    7698 28-SEP-81  
    1250  
    1400    
    30     
    5
    6  
    7698 BLAKE 
    MANAGER    
    7839 01-MAY-81  
    2850               
    30     
    6
    7  
    7782 CLARK 
    MANAGER    
    7839 09-JUN-81  
    2450     
    0    
    10     
    7
    8  
    7788 SCOTT 
    ANALYST    
    7566 19-APR-87  
    3000               
    20     
    8
    9  
    7839 KING  
    PRESIDENT       
    17-NOV-81  
    5000     
    0    
    10     
    9
    10  
    7844 TURNER
    SALESMAN   
    7698 08-SEP-81  
    1500     
    0    
    30    
    10
    10 rows selected.

  • I have multiple profiles and want to go back to a single profile without losing data or programs that are not shared

    Hi
    I need help
    My partner has set up multiple profiles on the iMac and has not done the sharing of files and software correctly.  Therefore we have some programs that do not operate in all profiles.  I want to go back to a single profile but need to be sure I am not going to lose any data or programs in the process. 
    Can any one give me a step by step guide - I am not mac savvy.
    Thanks in advance

    Hello!
    I recently just downloaded the 'Waze' app as a backup for my Garmin. I've read a few reviews that seem to rant and rave about how good the GPS app is. It is community driven and maps are constantly being updated by users. Plus it has a few other fun stuff in it (something similar to Gasbuddy where you can owe prices on the map). But like the person above me said, there is lots of useful free GPS apps in the App Store.
    Oh and I may be wrong but I remember reading an article about Google being slower about updating its maps system--ie no turn by turn voice, which many people have had complaints about.
    Happy Searching!
    Ps - if you switch I wouldn't go to Blackberry.

  • Ordering complex sets that are created inline

    I've been playing with a script of Chris Webb's found here:http://cwebbbi.wordpress.com/2007/06/25/advanced-ranking-and-dynamically-generated-named-sets-in-mdx/
    The adapted script is this:
    WITH
    SET MyMonths AS
    TopPercent
    [Date].[Calendar].[Month].MEMBERS
    ,20
    ,[Measures].[Reseller Sales Amount]
    SET MyEmployees AS
    [Employee].[Employee].[Employee].MEMBERS
    SET MyMonthsWithEmployeesSets AS
    Generate
    MyMonths
    ,Union
    {[Date].[Calendar].CurrentMember}
    ,StrToSet
    Intersect({},
    {TopCount(MyEmployees, 10, ([Measures].[Reseller Sales Amount],[Date].[Calendar].CurrentMember))
    as EmployeeSet"
    +
    Cstr(MyMonths.CurrentOrdinal)
    + "})"
    MEMBER [Employee].[Employee].[RestOfEmployees] AS
    Aggregate
    Except
    MyEmployees
    ,StrToSet
    "EmployeeSet" + Cstr(Rank([Date].[Calendar].CurrentMember,MyMonths))
    MEMBER [Measures].[EmployeeRank] AS
    Rank
    [Employee].[Employee].CurrentMember
    ,StrToSet
    "EmployeeSet" + Cstr(Rank([Date].[Calendar].CurrentMember,MyMonths))
    SELECT
    [Measures].[EmployeeRank]
    ,[Measures].[Reseller Sales Amount]
    } ON 0
    ,Hierarchize
    Union
    Filter
    MyMonthsWithEmployeesSets * MyEmployees
    [Measures].[EmployeeRank] >= 1
    MyMonthsWithEmployeesSets * [Employee].[Employee].[RestOfEmployees]
    ) ON 1
    FROM [Adventure Works];
    How do I ORDER the output so that each set of ten employees is in order 1 to 10, with the `MEMBER` called `RestOfEmployees` always found in position 11 i.e. it should follow the member ranked 10 ?

    I haven't had much time to look at this, but does the following do what you want?
    WITH
    SET MyMonths AS
    TopPercent
    [Date].[Calendar].[Month].MEMBERS
    ,20
    ,[Measures].[Reseller Sales Amount]
    SET MyEmployees AS
    [Employee].[Employee].[Employee].MEMBERS
    SET MyMonthsWithEmployeesSets AS
    Generate
    MyMonths
    ,Union
    {[Date].[Calendar].CurrentMember}
    ,StrToSet
    Intersect({},
    {TopCount(MyEmployees, 10, ([Measures].[Reseller Sales Amount],[Date].[Calendar].CurrentMember))
    as EmployeeSet"
    +
    Cstr(MyMonths.CurrentOrdinal)
    + "})"
    MEMBER [Employee].[Employee].[RestOfEmployees] AS
    Aggregate
    Except
    MyEmployees
    ,StrToSet
    "EmployeeSet" + Cstr(Rank([Date].[Calendar].CurrentMember,MyMonths))
    MEMBER [Measures].[EmployeeRank] AS
    Rank
    [Employee].[Employee].CurrentMember
    ,StrToSet
    "EmployeeSet" + Cstr(Rank([Date].[Calendar].CurrentMember,MyMonths))
    SELECT
    [Measures].[EmployeeRank]
    ,[Measures].[Reseller Sales Amount]
    } ON 0
    GENERATE(
    HIERARCHIZE(MyMonthsWithEmployeesSets),
    [Date].[Calendar].CurrentMember *
    {ORDER(
    FILTER(MyEmployees, [Measures].[EmployeeRank]>0)
    , [Measures].[Reseller Sales Amount], BDESC),[Employee].[Employee].[RestOfEmployees]} )
    ON 1
    FROM [Adventure Works];
    Chris
    Check out my MS BI blog I also do
    SSAS, PowerPivot, MDX and DAX consultancy
    and run public SQL Server and BI training courses in the UK

  • Is there any way to get at a result set that only has one entry when using

    And please dont tell me its because of the driver... I know this but cant do anything about it
    Using Access the only method available is rs.next() and I think that when the statement is prepared it goes to the first (and only) row, so when it executes the cursor is in the wrong place....
    Maybe someone could show me some code that stores the rs in somethingI can search through... Theres been some mention of vectors and hashtables but I've not used them (yet)!
    String fName = "empty";
    String query = "SELECT * FROM Committee WHERE UName LIKE ?";
    java.sql.PreparedStatement statement = connection.prepareStatement(query);
    statement.setString(1,user);
    java.sql.ResultSet rs = statement.executeQuery();
    while (rs.next())
    fName = rs.getString("FirstName");
    out.println("first: " + fName);
    This prints nothing
    However when I use:
    java.sql.Statement statement = connection.createStatement();
    java.sql.ResultSet rs = statement.executeQuery(""SELECT * FROM Committee WHERE UName LIKE 'pippip' ";
    It does!
    The user variable is printed onto the page to test it exists -which it does
    And it cant be sending null to the database or else I'd get a null pointer or sql exception...
    Its driving me nuts!!!

    And please dont tell me its because of the driver... I
    know this but cant do anything about it
    Using Access the only method available is rs.next()
    and I think that when the statement is prepared it
    goes to the first (and only) row, so when it executes
    the cursor is in the wrong place....
    Maybe someone could show me some code that stores the
    rs in somethingI can search through... Theres been
    some mention of vectors and hashtables but I've not
    used them (yet)!
    String fName = "empty";
    String query = "SELECT * FROM Committee WHERE UName
    LIKE ?";
    Like is only used when you want to compare approximate values using wild cards.
    You however are not using wildcards.
    If you want to do an exact match then you should use '='. If you want to approximate matches then you should use a wildcard: '%' or '_'.
    java.sql.PreparedStatement statement =
    connection.prepareStatement(query);
    statement.setString(1,user);
    java.sql.ResultSet rs = statement.executeQuery();
    while (rs.next())
    fName = rs.getString("FirstName");
    out.println("first: " + fName);
    This prints nothing
    However when I use:
    java.sql.Statement statement =
    connection.createStatement();
    java.sql.ResultSet rs =
    statement.executeQuery(""SELECT * FROM Committee WHERE
    UName LIKE 'pippip' ";
    It does!
    The user variable is printed onto the page to test it
    exists -which it does
    And it cant be sending null to the database or else
    I'd get a null pointer or sql exception...
    Its driving me nuts!!!

  • Why do SQL sample programs work when there is no entry for the data sources in the ODBC Data Source Administrator that are used by the sample program?

    Hi,
    I am trying to understand how to access an SQL database from CVI.  
    I don't understand how the sample programs shipped with the toolkit can access the database they use if it is not listed in the ODBC Data Source Administrator.
    In the code, I see the line:
    hdbc = DBConnect ("DSN=CVI SQL Samples");
    However, there is not an entry that I can find in the ODBC Administrator for "CVI SQL Samples."
    The SQL help suggests there should be a User DSN named, "CVI32_Samples", but I don't see that entry in the ODBC Administrator on my win-7 system.
    I believe the sample program is accessing a database file named, "C:\Users\Public\Documents\National Instruments\CVI\Samples\sql\samples.mdb".
    Exactly how is the call to DBConnect() translated to the file, "samples.MDB", if there is no entry in the ODBC Administrator?
    Regards,
    Mark 

    I figured it out.  There is a 32 bit ODBC administrator and a 64 bit ODBC administrator.  The ODBC administrator I run through the control panel is the 64 bit ODBC administrator. To access the 32 bit administrator I need to run, "C:\Windows\SysWOW64\odbcad32.exe".
    I am running the samples in 32 bit mode, so I need to use the 32 bit ODBC administrator.
    Best,
    Mark

  • Dates on photos that are downloaded....

    I have a strange one with this new Iphoto 08. It changed the date on a batch of photos to 2016. I cannot change it as I did with the other Iphotos and I want to be able to organize my downloads from to have the most recent at the top of the library. This puts this batch always at the top. How do I resolve this issue?

    select the photos with the bad dates and go to the Photos menu ==> adjust time and date (to make a constant Delta change to the photos keeping their relative time and dates the same) or batch change ==> date (to change them to an arbitrary set of times and dates)
    After fixing the photo dates the event date may still be incorrect (do not know if this bug has been fixed or not in the recent releases) - if it is post back here
    Larry Nebel

  • Tabular:Row Filter - If filtering on child record you still get parent records back that are not "parents" of that child record

    I have a tabular model that has States (StateID, StateName)
    Then I have Cities (CityID, StateID,CityName)
    Employees(EmpID, CityID, Login ID)
    When I then go and setup a row filter so that my Employees table filters on their windows login name so they only see a few CITYIDs per employee.
    =Cities[CityID]=LOOKUPVALUE(Employees[CityID],Employees[Login Id],USERNAME(),Employees[CityID],Cities[CityID])
    The table Cities is related to States via PK States[StateID] and FK Cities[StateID] (so the arrow goes from Cities and points to States)
    What gets odd here is that when I connect with a user who only has cities in 2 states, I see OTHER states for which that user has no cities.
    I don't understand that.  If they have Cities of Des Moines (Iowa) and Madison (Wisconsin) why are they seeing any states other than those two states?
    The user sees ONLY the cities they are supposed to...why are they seeing States that aren't related to their cities?

    Hi,
    The DAX formula you posted was fine. Have you define the relationship between "Employees" and "Cities" tables(Employees->Cities)?
    Please go through the following articles regarding implement dynamic security by using row filters, maybe we have missed anything:
    Implement Dynamic Security by Using Row Filters:
    http://msdn.microsoft.com/en-us/library/hh479759(v=sql.110).aspx
    Dynamic Security in Tabular:
    http://www.bidn.com/blogs/ChrisSchmidt/ssas/4332/dynamic-security-in-tabular
    If you have any feedback on our support, please click
    here.
    Regards,
    Elvis Long
    TechNet Community Support

  • DOM events not propigating to Iframe that are in parent element that have a js library applied

    I have a site: http://stage.globalpost.com/special-reports/burmese-journey
    The videos on slide #2 and #3, which are embedded using iframes are not able to be activated or clicked
    Tried everything to get this to work, pointer-events, z-index, ect. It works in all modern browsers and Firefox PC, but not Firefox mac.

    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • How to do Excise Invoice?

    Hi Friends,          I am new to excise concept, My client is a manufacturing company, they are manufacturing machines. so they are using this excisable concepts and excise tax.    They are using CENVAT 10.3 % Tax, i have created that but in normal i

  • User profile in WINDOWS 8.1, 8, 7 redirected to C:\Windows\System32\config\systemprofile

    Hi all, When you are logging into Windows 8.1,8 or 7 using your user credential you will finaly end up as system service account or at least your profile will be recognized this way. This mean that system is now looking in C:\Windows\System32\config\

  • Should I install Print Services as a role for a single server env no domain

    I have a OAS application using converted UNIVERSE code to work with withSQL server. The application works fine and local users and groups will do the job. I have been tasked with replacing UNIX based printing to Windows based printing. Don't need LDP

  • Create an Image

    Hie.. i've browse through the forum to search a solution to my problem but i dont find any resourceful. I hope someone could help me out. Here is the problem :- I tried to create an Image using byte of array as such :- ** the message is in byte curre

  • Script to populate email address in Order Header attachment

    Hi Experts, I need a help for inserting Order header attachment. We have email address of the customer stored in Order Header attachment in Short text / Long Text under the Category: Customer Email Address. I need a PLSQL script which created the ema