Query - data from two versions in the same column

Hello
Let me share my business scenario. Maybe you will be able to help me to desgn a query I am looking for.
I have data in my Info Cube:
- Version (A for plans and B for actuals)
- Calendar Month,
- Sales Amount.
I would like to create a query which presents Sales Amount per every Calendar Month, but:
- Data of version B for all of the months before current one (actuals)
- Data of version A for the current one and all of the nex ones (plans)
In result I expect the matrix like this:
Calendar Month     Sales Amount
2011.01          200 (it is taken from version B - actuals)
2011.02          300 (it is taken from version B - actuals)
2011.03          260 (it is taken from version A - plans)
2011.04          230 (it is taken from version A - plans)
2011.05          200 (it is taken from version A - plans)
Is it possible?
Cheers,
A.

Hello Brian,
Thank you for your answer. It is approach I will use, I think. However let me ask: Would it be possible to have a Version in this layout, too? I mean to see, which value comes from Version A and which comes from Version B? Something like this:
Calendar Month Version Sales Amount
2011.01  B  200
2011.02  B  300
2011.03  A  260
2011.04  A  230
2011.05  A  200
A

Similar Messages

  • Data from two tables in the same row in XML transformation

    Hi,
        I am using XML transformation for generating excel file which is to besent as email attachment.
        Here  I want to display the data from two internal tables in the same row in the excel. .I am using   <tt:loop ref=".<table name>"> ...  </tt:loop> for looping through the table. Can I loop two table simultaneously ? In that case how will I specify the fields in each table . Some of the fields in two tables are of same name and type.
    Please help...
    Thanks,
    Jissa

    Hello Brian,
    Thank you for your answer. It is approach I will use, I think. However let me ask: Would it be possible to have a Version in this layout, too? I mean to see, which value comes from Version A and which comes from Version B? Something like this:
    Calendar Month Version Sales Amount
    2011.01  B  200
    2011.02  B  300
    2011.03  A  260
    2011.04  A  230
    2011.05  A  200
    A

  • Print data in two line in the same column

    Hi,
    In a tabular Report I want to print a column (eg:Description,) in two lines in the same cell.
    Since the description is too long. Is it possible in report 6i. Or any other solution for this?
    Please reply.

    Hello,
    For the Description field set the Vertical Elasticity to EXPAND. Then it will adjust automatically based on data.
    -Ammad

  • Data from different databases in the same report.

    Hi Everyone,
    I am trying to build a reconciliation report in which I need to show the data from the source and target, side by side.
    Source and target are both different databases, although being oracle only
    Whenever a new data model is created, it gets attached to a data source and in the report we need to choose a specific data model.
    Can we have data from different databases in the same report ?

    Yes, it is possible.
    One way Is to use dataTemplates. There you can make queries from any number of different databases (The max I have done is 5).
    It looks something like that:
    <dataTemplate name="NameOfTemplate">
    <dataQuery>
         <sqlStatement name="Q1" dataSourceRef="Connection1">
              <![CDATA[     select * from table1]]>
         </sqlStatement>
         <sqlStatement name="Q2" dataSourceRef="Connection2">
              <![CDATA[     select * from table2]]>
         </sqlStatement>
      </dataQuery>
      <dataStructure>
         <group name="RESULT1" source="Q1">
              <element name="P_FIRST_NAME" value="P_FIRST_NAME"/>
         </group>
         <group name="RESULT2" source="Q2">
              <element name="P_DATE" value="P_DATE"/>     
         </group>
      </dataStructure>
    </dataTemplate>dataStructure is very important when you get data from different places, if you don't define those elements, then only the result from Q1 is shown.
    The second possible way is to make as two different data models, each containing their own query and then set Main Data Set as concatenated SQL Data Source.
    Best of luck,
    Evelyn

  • When I OCR two versions of the same document and then compare th documents in Acrobat Pro XI, I usually get the message that there are no changes to mark.  However, I know there a quite a few number of changes.  I raised this question more than a year ago

    When I OCR two versions of the same document and then compare the documents in Acrobat Pro XI, I usually get the message that there are no changes to mark.  However, I know there a quite a few number of changes.  I raised this question more than a year ago, and the response I received had to do with the quality of the OCR and the scans of the documents.  However, if I use Acrobat Pro XI to save the same documents in Word and then run a comparison in Word all of the changes are marked.  When a PDF is saved as a Word document in Acrobat Pro XI, is a different OCR module being used than the one used in Acrobat Pro XI for text recognition?

    OCR is only for recoginition of the image / picture of text provided by an scanner.
    Content typed into a Word file which is converted to a PDF is (in Word and in PDF) *not* an image  or picture of text - it is the digital text. So, no OCR involved.
    When the "digital" (renderable) text of a PDF's page content is exported to Word no OCR is involved.
    When a PDF's content is from the image output of a scanner and this is a picture of text then OCR comes into play.
    If this content is exported to Word before doing OCR then it is the image that is exported to the Word file.
    Once OCR is performed it is the OCR output that is exported.
    OCR output is (always will be) impacted by "the quality of the OCR and the scans of the documents". 
    Regardless "Compare" is based on a Word file output to PDF1 then edits to the Word file followed by an output to PDF2. You use Acrobat Pro to do a compare of PDF1 & PDF2.
    Paper 1 scanned to image 1 to image 1 in PDF1 that gets OCR 1 and
    Paper 2 scanned to image 2 to image 2 in PDF2 that gets OCR 2
    being processed with Acrobat Pro's Compare can certainly be done.
    But - well you've described what can be observed.
    Be well...

  • I downloaded two versions of the same album by mistake can I get a refund on one?

    I downloaded two versions of the same album, one staight after the other, I've been charged for both, can I get one removed and a refund?

    Carol,
    William Lloyd said it all, but perhaps Kirby Krieger's User Tip will explain a bit more the different uses of albums and projects:
                       The Well-Trod Path: a Beginner's Guide to how Aperture's major parts inter-relate
    Then I imported into Aperature, created new versions, one for each snapshot, then cropped each snapshot, so each snapshot is seperate in Aperature.
    You want to find each snapshot separately in Aperture? Perhaps you could explain more, how you want to organize your photos. William pointed out albums to group versions of an image. You could also assign keywords to mark special occasions like birthdays, weddings, etc.  You could assign faces to find photos of persons by name. You can use the search field in the browser to search for photos by face, date, keyword, etc.  Aperture is really great for accessing images in many different ways. There must be a way to access the images in your Aperture library just like you want to.
    Then, I tried to organize the ton of photos into projects and it won't let multiple versions of the same original photo be in separate projects.
    That is, how Aperture works. All versions of an image need to be in the same project, because they are sharing the same imported original image file. Aperture tries to save your disk space, by by not creating image files for the edited versions. Versions are just a set of instructions how to produce the rendered image, when you want to edit it or to export it. Unless you are working with the version, it will live in limbo and it will not exist as an image file. So all versions are kept together in the same project with the original image file that is necessary to render them as an image.
    Léonie

  • Cartesian of data from two tables with no matching columns

    Hello,
    I was wondering – what’s the best way to create a Cartesian of data from two tables with no matching columns in such a way, so that there will be only a single SQL query generated?
    I am thinking about something like:
    for $COUNTRY in ns0: COUNTRY ()
    for $PROD in ns1:PROD()
    return <Results>
         <COUNTRY> {fn:data($COUNTRY/COUNTRY_NAME)} </COUNTRY>
         <PROD> {fn:data($PROD/PROD_NAME)} </PROD>
    </Results>
    And the expected result is combination of all COUNTRY_NAMEs with all PROD_NAMEs.
    What I’ve noticed when checking query plan is that DSP will execute two queries to have the results – one for COUNTRY_NAME and another one for PROD_NAME. Which in general results in not the best performance ;-)
    What I’ve noticed also is that when I add something like:
    where COUNTRY_NAME != PROD_NAME
    everything is ok and there is only one query created (it's red in the Query plan, but still it's ok from my pov). Still it looks to me more like a workaround, not a real best approach. I may be wrong though...
    So the question is – what’s the suggested approach for such queries?
    Thanks,
    Leszek
    Edited by xnts at 11/19/2007 10:54 AM

    Which in general results in not the best performanceI disagree. Only for two tables with very few rows, would a single sql statement give better performance.
    Suppose there are 10,000 rows in each table - the cross-product will result in 100 million rows. Sounds like a bad idea. For this reason, DSP will not push a cross-product to a database. It will get the rows from each table in separate sql statements (retrieving only 20,000 rows) and then produce the cross-product itself.
    If you want to execute sql with cross-products, you can create a sql-statement based dataservice. I recommend against doing so.

  • Can I have two versions of the same original live in separate projects?

    I am not an Aperature or photography expert.
    I scanned in a ton of old family photos with multiple snaphots on a page and in a single file. Then I imported into Aperature, created new versions, one for each snapshot, then cropped each snapshot, so each snapshot is seperate in Aperature. (I could have learned Spanish with all the time that this took.)
    Then, I tried to organize the ton of photos into projects and it won't let multiple versions of the same original photo be in separate projects. I found a way to change the filenames through Batch Change, but that didn't fix the problem.
    I would like to organize the ton of files, but from what I can tell my only option would be to go back to the scanned files, make copies from Finder as needed, once for each snapshot, reimport into Aperature and recrop each individual snapshot.
    Oh my, I have kids and a job and a husband and I like to sleep at night. Is there any easier way to organize the photos?
    Thank you for your time.
    Carol

    Carol,
    William Lloyd said it all, but perhaps Kirby Krieger's User Tip will explain a bit more the different uses of albums and projects:
                       The Well-Trod Path: a Beginner's Guide to how Aperture's major parts inter-relate
    Then I imported into Aperature, created new versions, one for each snapshot, then cropped each snapshot, so each snapshot is seperate in Aperature.
    You want to find each snapshot separately in Aperture? Perhaps you could explain more, how you want to organize your photos. William pointed out albums to group versions of an image. You could also assign keywords to mark special occasions like birthdays, weddings, etc.  You could assign faces to find photos of persons by name. You can use the search field in the browser to search for photos by face, date, keyword, etc.  Aperture is really great for accessing images in many different ways. There must be a way to access the images in your Aperture library just like you want to.
    Then, I tried to organize the ton of photos into projects and it won't let multiple versions of the same original photo be in separate projects.
    That is, how Aperture works. All versions of an image need to be in the same project, because they are sharing the same imported original image file. Aperture tries to save your disk space, by by not creating image files for the edited versions. Versions are just a set of instructions how to produce the rendered image, when you want to edit it or to export it. Unless you are working with the version, it will live in limbo and it will not exist as an image file. So all versions are kept together in the same project with the original image file that is necessary to render them as an image.
    Léonie

  • 0PA_C01  different results from two queries on the same cube ....

    HI
    Can you please help with this  problems ...
    i am running a two queries with the same restrictions e.g
    Sep 08 for employee 22345 ,
    In one report it shows the Pay Scale level as A1 , then in the other report it shows Pay scale Scale level as A2  ,
    looking  at the master data in 0employee  , the first report is right ... this is how the data looks like in 0employee
    Employee  Valid from      To                Pay scale Level
    222345       2007-11-03   2008-09-30     A1
    222345       2008-10-01   9999-12-31     A2
    Can someone please shed some light on this , im thinking it has something to do with update rule but even that is supposed to use last date of the month , not 1st day of the following month. The Cube is a stndard cube 0PA_C01 and the update rule aswell .....

    Hi,
    Please check in the cube whether the data for the Employee is getting with two values like shown in your question:
    Employee Valid from To Pay scale Level
    222345 2007-11-03 2008-09-30 A1
    222345 2008-10-01 9999-12-31 A2
    and also check whether when the data loaded to the cube.
    There may be some change in the report structure where the difference is getting may in the column wise or row wise restriction may present.
    Please check on the structure of the report also.
    With Regards,
    Ravi Kanth

  • [Bug] Writing to the same trace in Citadel from two Sources at the same time

    Howdy
    I am experiencing an issue and am looking to get some NI support:
    I have two distributed applications that can write to a Citadel database at the same time.
    And I am investigating the possibility of what would occur if both of them were writing to the same variable at the same time, with possibly the same timestamp data.
    I did this in the attached VI by using the same timestamps with a constant for the data (either #1 or #2).
    This generates an error, as expected, stating you cannot have two references open at the same time.
    The data file, dumped from Citadel, contains 1000pts with all data from only one of the arrays (in this case #2) and everything looks fine:
    However, what appears to be happening randomly tho, is that the same portion of code can also returns no error.
    When the data is dumped from Citadel this file contains 2001pts - 1000pts from each array and one separator (or break) point:
    You cannot write an older timestamp to Citadel without it throwing an error, but from further testing it seems you can write the same timestamp repeatably. So I am guessing what is happening above is race condition that is somehow allowing two references to be opened to Citadel which should throw an error but it does not and this is somehow allowing both sets of data to be written by both loops??
    The data, IMO, is now corrupted.
    Is being able to write to the same timestamp a desirable feature?
    Or is this a known issue or a bug?
    What about acquiring two references - bug?
    Is there a workaround to protect the data from multiple distributed-application writes?
    Cheers
    -JG
    Attached VI was coded and tested using LabVIEW 2009 SP1, DSC 9.0.1, MAX 4.6.2f1
    Certified LabVIEW Architect * LabVIEW Champion
    Attachments:
    dual_databaseWrite.vi ‏21 KB

    Ben S wrote:
    The race condition of opening the refererence in two places at once should still apply to two different VIs running at the sametime.
    Will a CAR be lodged for this?
    Ben S wrote:
    If you open up the code and save it as a .vit, you don't get any missing VIs. Only when you change the extension without the aid of LabVIEW.
    No VI should have missing members by simply renaming its extension outside of LabVIEW???
    I think there is an issue with the VI.
    Can you replicate the following and verify what I am seeing?
    Attached is a Project with Main VI (contains a call to the Open Trace.vi polymorphic only), a Class and a Build Spec
    If you Build the spec with the Main VI outside of the Class it works
    If you place the VI in the Class, save then Build, the Spec fails with the error:
    Visit the Request Support page at ni.com/ask to learn more about resolving this problem. Use the following information as a reference:
    Error 1003 occurred at AB_Application.lvclasspen_Top_Level_VIs.vi -> AB_Build.lvclass:Build.vi -> AB_Application.lvclass:Build.vi -> AB_EXE.lvclass:Build.vi -> AB_Engine_Build.vi -> AB_Build_Invoke.vi -> AB_Build_Invoke.vi.ProxyCaller
    Possible reason(s):
    LabVIEW:  The VI is not executable. Most likely the VI is broken or one of its subVIs cannot be located. Select File>>Open to open the VI and then verify that you are able to run it.
    Visit the Request Support page at ni.com/ask to learn more about resolving this problem. Use the following information as a reference:
    Error 1003 occurred at AB_Application.lvclass:Open_Top_Level_VIs.vi -> AB_Build.lvclass:Build.vi -> AB_Application.lvclass:Build.vi -> AB_EXE.lvclass:Build.vi -> AB_Engine_Build.vi -> AB_Build_Invoke.vi -> AB_Build_Invoke.vi.ProxyCaller
    Possible reason(s):
    LabVIEW: The VI is not executable. Most likely the VI is broken or one of its subVIs cannot be located. Select File>>Open to open the VI and then verify that you are able to run it.
    Next place a disabled structure around the Polymorphic VI (as Class Member or not, it doesn't matter)
    Save the VI
    Close the VI
    Open the VI - the Open Trace.vi polymorphic is "missing"
    Cheers
    -JG
    Code in LV2009
    Certified LabVIEW Architect * LabVIEW Champion
    Attachments:
    DSC.zip ‏341 KB

  • Merge Two Tables with the same columns but different data

    I have a table that has the following columns:
    Current Table Definition
    commonname
    family
    genus
    species
    subspecies
    code
    I have a number of entries that don’t fit the current table definition – that is that they only have a common name or description and a code. These records don’t actually represent a species but are needed for data entry because they represent an object that may be encountered in the study (Bare Ground – which isn’t a species but would need to be recorded if encountered). So I would really like 2 tables:
    Table 1 Miscellaneous
    name
    code
    Table 2 Plant Species
    commonname
    family
    genus
    species
    subspecies
    code
    I would like two tables so I can enforce certain constraints on my species table like requiring that the family, genus, species, subspecies combination is unique. I can’t do this if I have all the “other” records that don’t have a family, genus, species, or subspecies unless I put in a lot of dummy data into the fields to make each record unique. I don’t really want to do this because these miscellaneous records really don’t represent a specific species.
    So – the problem is that while I want this data separate I will need to point a column from another table to the code column in both tables.
    How is this best done? Table? View? Merge?

    Hi,
    Actually you don't have to use scope refs. Sorry but I misunderstood you earlier. Here is a complete example that does exactly what you want. Notice how I added the constraint to the materialized view. Also notice when we try to insert a code in tbl3 that doesn't exist in the view, we get an error. HTH.
    SQL> create table tbl1 (name varchar2(10), code varchar2(3) primary key);
    Table created.
    SQL> create table tbl2 (commonname varchar2(10), code varchar2(3) primary key);
    Table created.
    SQL> insert into tbl1 values ('n1','c1');
    1 row created.
    SQL> insert into tbl1 values ('n2','c2');
    1 row created.
    SQL> insert into tbl1 values ('n3','c3');
    1 row created.
    SQL> insert into tbl2 values ('name1','c1');
    1 row created.
    SQL> insert into tbl2 values ('name2','c2');
    1 row created.
    SQL> insert into tbl2 values ('name3','c3');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> create materialized view view1 as select name, commonname, tbl1.code from tbl1, tbl2 where tbl1.code = tbl2.code;
    Materialized view created.
    SQL> select * from view1;
    NAME COMMONNAME COD
    n1 name1 c1
    n2 name2 c2
    n3 name3 c3
    SQL> create table tbl3 (code varchar2(3), record varchar2(1));
    Table created.
    SQL> alter table view1 add constraint view1pk primary key (code); -- <-Note how I added a constraint to the view
    Table altered.
    SQL> alter table tbl3 add constraint tbl3fk foreign key (code) references view1(code);
    Table altered.
    SQL> insert into tbl3 values ('c1','r');
    1 row created.
    SQL> insert into tbl3 values ('c99','r');
    insert into tbl3 values ('c99','r')
    ERROR at line 1:
    ORA-02291: integrity constraint (RAJS.TBL3FK) violated - parent key not found
    SQL> spool of;
    -Raj Suchak
    [email protected]

  • I pre-ordered two versions of the same album on ITunes! How to stop?

    So a few minutes ago I accidently preordered 2 versions of the same album on Itunes on my dell laptop! I want to cancel one, but i dont know how! It told me that you pay for it when it is realsed in November so I have not payed yet for either.

    Select all the songs from the album, choose File--> Get Info, then under the Album area, type in the appropriate album title.  They should all appear under one album at that point.

  • HELP! How to install two versions of the same driver???

    Hello,
    Here is my scenario... I am a video chat host on different sites. I recently purchased two of the same Creative Live! Ultra webcams. When I try to broadcast on the 2nd site with the 2nd camera the other goes fuzzy and starts freaking out.
    Is there a way to install two versions of the driver and run both cameras at once without conflict? Please advise what to do since I would like to use these cams.
    Thank you for your help.
    Tara

    tara2nz wrote:
    Hello, Here is my scenario... I am a video chat host on different sites. I recently purchased two of the same Creative Live! Ultra webcams. When I try to broadcast on the 2nd site with the 2nd camera the other goes fuzzy and starts freaking out. Is there a way to install two versions of the driver and run both cameras at once without conflict? Please advise what to do since I would like to use these cams. Thank you for your help. Tara
    Hi, i don't know the aswer but i've the same question. I'm about to get 4 webcams, I think live! Ultra is the best model in market but i've to be sure if there's a way to plug 4 webcams together.
    Thank's for all.

  • Delete from two tables at the same time

    Hi,
    Is there way to delete from many tables at the same time ?
    delete from tbl1, tbl2;
    Thank you

    953402 wrote:
    Hi,
    Is there way to delete from many tables at the same time ?
    delete from tbl1, tbl2;
    Thank youNO
    Consider to actually Read The Fine Manual below
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/toc.htm

  • One target table is loading from two different source but same columns but one source is in a database and other is in a flat file.

    Hope you all are doing good.
    I have a business issue to be implemented in ODI 11G. Here it is. I am trying to load a target table from two sources having same coulmn names. But one source is in file format and other is in Oracle Database.
    This is what i think i will create two mappings in the same interface using Union between the sources. But i am not sure how the interface would connect to different logical architecture to connect to two different sources.
    Thanks,
    SM

    You are on the right track, this can all be done in a single interface. Do the following
    1) Pull your file data model into the source designer and and your target table model to the target pane.
    2) Map all the relevant columns
    3) In the source designer create a new dataset and choose the UNION join type (this will create a separate tab in the source designer pane)
    4) Select the new dataset tab in the source designer pane and pull your source oracle table data model into the source designer. Map all the relevant columns to the target
    5) Make sure that your staging location is defined on a relational technology i.e. in this case the target would be an ideal candidate as that is where ODI will stage the data from both file and oracle source and perform the UNION before loading to the target
    If you want to look at some pretty screenshots showing the steps above take a look at http://odiexperts.com/11g-oracle-data-integrator-part-611g-union-minus-intersect/

Maybe you are looking for