OLAP universe query filters using multiple key values

Hi,
We are running BO over a MSAS 2005 cube and due to reporting requirements we have had to split the year out from the standard time hierarchy so we have it as a separate hierarchy from the rest of the time hierarchy. We also have 2 other dimension objects we use to find the current reporting month (shown below as Current Month and Current Year) which link to the Year and Month dimensions to give us the current year and current month.
I have created predefined filters in the universe for Last Month and Last 6 Months etc which link the 2 hierarchies together to dynamically find the correct months to pull out based on the current reporting month.
The issue i am facing is that when these filters are used in reports we are not able to pull through the Year dimension in the report as we receive the error: "The Year Hierarchy hierarchy is used more than once in the Crossjoin function"
We can however use the Month dimension in reports even though it is also referenced in the filter definition.
I have narrowed the issue down to the fact the Month dimension is mentioned in the Filter Key which allows it to be used in the reports.
Is it possible to include 2 key values or are there any other ideas on how to tackle this problem so i can include the both the year and month in reports using these filters?
Last Month filter:
<FILTER KEY="@Select(Period To Date\Month).[TECH_NAME]"><CONDITION OPERATORCONDITION="InList"><CONSTANT TECH_NAME="CASE WHEN FILTER(@Select(Period To Date\Month).Members,@Select(Period To Date\Current Month).[Y]).Item(0)= @Select(Period To Date\Month).[January] THEN {CrossJoin(FILTER(@Select(Period To Date\Month).Members,@Select(Period To Date\Current Month).[Y]).Item(0).lead(11),FILTER(@Select(Period To Date\Year).Members,@Select(Period To Date\Current Year).[Y]).Item(0).lag(1))} ELSE CrossJoin(FILTER(@Select(Period To Date\Month).Members,@Select(Period To Date\Current Month).[Y]).Item(0).lag(1),FILTER(@Select(Period To Date\Year).Members,@Select(Period To Date\Current Year).[Y]).Item(0)) END"></CONSTANT></CONDITION></FILTER>
Thanks in advance

Dear Daniel, may I ask one more question please?
what if I have 4 tables?
table1
ID * ID_Type_code * Name
0001 * 11 * abc
0002 * 12 * abcd
0003 * 13 * abcde
table2
ID * OID_type_code * Name
0001 * 22 * abc
0002 * 23 * abcd
0002 * 25 * abcd
0003 * 23 * abcde
0003 * 22 * abcde
0003 * 28 * abcde
table3
ID * OID_type_code * OGAD_line_id * address
0001 * 22 * 1 * a street
0001 * 22 * 2 * b street
0002 * 23 * 1 * c street
0002 * 25 * 1 * d street
0003 * 28 * 1 * e street
0003 * 28 * 2 * f street
0003 * 28 * 3 * g street
table 4
ID OID_type_codeOGAD_line_id*COP_line_id*phone number
0001*22*1*1*2222222222
0001*22*1*2*3333333333
0002*23*1*1*4444444444
0003*28*2*1*5555555555
0003*28*2*2*6666666666
Primary key for each table
table1, primary key is ID
table2, primary key is ID , OID_type_code
table3, primary key is ID , OID_type_code, OGAD_line_id
table4, primary key is ID , OID_type_code, OGAD_line_id , COP_line_id
I would like to show each value in each table in the separate input text fields.
Therefore, this is an advanced question based on the previous one, not only get values from one table but also from several tables based on input for example 0003 and 28 as the ID and OID_type_code?.
Let me know if you need more details,
Thank you so much,
Viola

Similar Messages

  • Using multiple key values to find data

    Hello, It's me again.
    I had a question about bring data out from Database and show on an ADF page on Jdev 11.1.1.3.
    And Mr. Daniel Atwood     answered my question with this follow blog he wrote.
    http://www.avioconsulting.com/blog/datwood/2012/06/19/using-bpm-process-variable-adf-form-retrieve-database-information-0.
    But I have another question on the top of that.
    The example Mr.Atwood provided is when you using "one" key value, what if I have two key values, how to set this up?
    Here are some details:
    I have a table like this
    ID     Type_code     Name
    0001      05      a-blabla
    0002     25      b-blabla
    0002     26      b-blabla
    0003      08      c-blabla
    0003      25      c-blabla
    0003     79      c-blabla
    What I want to do is after input the ID(0003) and type_code (25), it will show me the result on three input text components in ADF page with value 0003, 25 and c-blabla.
    Currently, I can use only ID to query the data, but I would like to use two key values to find the specific data.
    Thank you very much for taking time to think about this,
    Sincerely,
    Viola

    Dear Daniel, may I ask one more question please?
    what if I have 4 tables?
    table1
    ID * ID_Type_code * Name
    0001 * 11 * abc
    0002 * 12 * abcd
    0003 * 13 * abcde
    table2
    ID * OID_type_code * Name
    0001 * 22 * abc
    0002 * 23 * abcd
    0002 * 25 * abcd
    0003 * 23 * abcde
    0003 * 22 * abcde
    0003 * 28 * abcde
    table3
    ID * OID_type_code * OGAD_line_id * address
    0001 * 22 * 1 * a street
    0001 * 22 * 2 * b street
    0002 * 23 * 1 * c street
    0002 * 25 * 1 * d street
    0003 * 28 * 1 * e street
    0003 * 28 * 2 * f street
    0003 * 28 * 3 * g street
    table 4
    ID OID_type_codeOGAD_line_id*COP_line_id*phone number
    0001*22*1*1*2222222222
    0001*22*1*2*3333333333
    0002*23*1*1*4444444444
    0003*28*2*1*5555555555
    0003*28*2*2*6666666666
    Primary key for each table
    table1, primary key is ID
    table2, primary key is ID , OID_type_code
    table3, primary key is ID , OID_type_code, OGAD_line_id
    table4, primary key is ID , OID_type_code, OGAD_line_id , COP_line_id
    I would like to show each value in each table in the separate input text fields.
    Therefore, this is an advanced question based on the previous one, not only get values from one table but also from several tables based on input for example 0003 and 28 as the ID and OID_type_code?.
    Let me know if you need more details,
    Thank you so much,
    Viola

  • Multiple key-value pairs in JNLP file

    Dear All,
    I have a JNLP file with multiple key-value pairs :
    <resources>
         <j2se version="1.4+"/>
         <jar href="lib/myFile.jar"/>
         <property name="url" value="URL/db"/>
         <property name="default" value="10"/>
         <property name="m1_query" value="URL1"/>
         <property name="m2_query" value="URL2"/>
         <property name="m3_query" value="URL3"/>
         <property name="p1_query" value="URL4"/>
         <property name="p2_query" value="URL5"/>
         <property name="p3_query" value="URL6"/>
         <property name="p4_query" value="URL7"/>
       </resources> I dont know what the key names are in the JNLP file so I cant use getProperty(keyname) directly. Is it possible to read all the key-value pairs in a HashMap and iterate through the list?
    Or is there any other way of dealing with it?
    Many thanks in advance.
    Regards
    Anuj

    Hi Riem,
    Thanks for your help ...
    while waiting for a reply ... I managed to do sort out my problem.
                     Properties p = System.getProperties();
                     for (Enumeration enu = p.propertyNames() ; enu.hasMoreElements() ;) {            
                       String key = (String)enu.nextElement();
                       Object value = p.getProperty(key);
                       if(!value.equals("")) {
                              keyValues.put(key, value);
                     }Thanks for your help.
    Cheers
    Anuj

  • How to deselect query property 'suppress repeated key values'

    hj gurus,
    In BEx analyser there is a query property 'suppress repeated key values' which can be de-selected.
    regards,
    Preety

    Hello preety.
    Is simple.
    In BEx query designer push the button designated by "query properties" (the 13 button from left to right).
    Go to the tab "Display" and mark the second option "Hide Repeated Key Values"
    And there you go.
    Please assign points.
    Diogo.

  • Query Designer - Hide Repeated Key Values - Doesn't work in the web

    Hello Experts,
    I'm facing a problem with a query. The user requested that he/she wants to see all the values of the key values.
    I already unchecked the option "Hide repeated key values" in query designer, but it still hiding it. I tested in BEx and it's working fine, but when I run it in the web the key values are being hidden.
    Anyone knows what is happening? I'm not using WAD and there is no possibility to use it.
    Thanks,
    Helder

    Hi,
    I have seen this problem - setting that option still does not show the repeated key values in web. You will indeed need to use WAD and uncheck that option in the properties of the analysis item. If you can't do that, the other option would be to do this change in the default web template (which is generally 0Analysis_pattern for BI WAD) but note that this will affect all queries.
    Also, please note that if the query is exported to excel, it will show the repeated values. This is the reason sometimes the users ask for key values to be repeated - maybe you would want to confirm that.

  • How to insert autoincrement record and query it with multiple keys

    Hi all,
    I am not familiar with BerkeyleyDB, I am now doing a project that needs to insert records and then query it out with multiple keys at later time. Since there is no field that can be distinct primary key, I want to user DbSequence as auto increment primary key to db, and set other index keys as secondary db, then using join cursor to do query with multiple keys.
    I don't know how to use DbSequence, can anyone direct me to a example of using DbSequence as auto increment primary key?
    Regards
    -Bruce

    I figured out the method to insert record with auto increment primary key. I listed the code block below:
    char m_SeqNamePositions[32] = "MyPositions";
    DbSequence *m_pSeqPositions;
    m_pDBPositions = new Db(NULL, 0);
              m_pDBPositions->open(NULL, pszFileName, szFileName, DB_BTREE, DB_CREATE, 0);          // 无数据文件
              m_pSeqPositions = new DbSequence(m_pDBPositions, 0);
              Dbt key((void *)m_SeqNamePositions, (u_int32_t)strlen(m_SeqNamePositions));
              m_pSeqPositions->open(NULL, &key, DB_CREATE);
    db_seq_t SeqNum;
         m_pSeqPositions->get(0, 1, &SeqNum, 0);
         Dbt key((void *)&SeqNum, (u_int32_t)sizeof(SeqNum));
         Dbt data(pRecord, sizeof(*pRecord));
         return m_pDBPositions->put(NULL, &key, &data, DB_NOOVERWRITE);
    m_pSeqPositions->close(0);
              m_pDBPositions->close(0);
    delete m_pSeqPositions;
    delete m_pDBPositions;
              m_pDBPositions = NULL;

  • Non-Database Item Sort Using Multiple Block Values

    I need to sort the result set of a block based on a calculated item. I found several messages addressing this, however they all speak to using the columns from within the same block as input variables to the function used to calculate the non-database column value.
    My problem is that I need to use values from a different block as input variables. I have not found a way to use them since I need to use the full block.column syntax. Forms does not like this and always thows an error right at the period(.). I need to do this because the column names are the same in each block. the function compares the column values and changes the record instance background a different color based based on how many of the column pairs match. Each block is mutually exclusive from each other and doing a accurate join is not really possible.
    I tried renaming the block column name to something unique, however I get a variable not bound error when I try to use it in the order by function even though their values are in the top most block.
    For Example:
    First Block. Contains a list of cases that need to be worked because the automated process could not find a valid provider based on the values received. This list is created by a background process.
    Table: CASE_MAIN
    TIN
    CASE_ID
    FCLTY_CM
    MEDICARE_CM
    Unrelated Second Block (i.e., no join). It uses the TIN value in the first block to get a list of all of the providers for the TIN associated with the Case so that a person can assign the correct Provider to the case (A TIN has a provider and address associated with it). As a result there is no link to the results of this table and the CASE_ID. That's what the users needs to do manually
    Table: PROVIDER_MAIN
    FCLTY
    MEDICARE
    I need to take the values in the first block and compare them in the second block so that I can recolor the background based on matching logic in the function below.
    order by clause = get_vals( ''||:FCLTY_CM||''
    ,''||:MEDICARE_CM||''
    ,fclty
    ,medicare) desc
    I am able to do the coloring within the form easily, however I need to order them by how many values match exactly so the ones that match to most value pairs show at the top. Hence ordering by the result of the function. I return a 0,1, or 2 based on the matches. 0 for none and 2 for both.
    I cannot create a view because the sources of the information I need to compare are NOT related to each other, yet. that is what the application is designed to do. I have a case without a
    provider assigned, but I have a tax id number that possible identifies the provider. I use this TIN to query the provider table for all of the possible providers under that TIN. As a result there is no link between the case information and provider information. The goal is to get this list compare the values from the target information and put the most likely matches on top, with
    the ones with the most matches first. I can create a function many ways that takes in various parameters. For example Case ID and Provider Id and query the records in subselects
    individually like so;
    select count(*)
    from (select fclty, medicare from case_main where case_id p_case_id) cm
    ,(select fclty, medicare from provider_main where prv_id = p_prv_id) pm
    where cm.fclty = pm.fclty
    and cm.medicare = pm.medicare
    If the number is greater than zero I know I have a match with that provider and I can sort accoringly. I can also pass in the target information from case_main and the provider inforation from provider_main and then do an if/then statement for comparing. Then I can use this function to create a column value for each record and then use the same reference to the function in the order by clause to order by that value.
    The problem comes in trying to reference the case_id or target information from a different block than where the fucntion needs to be used. I get a variable bound not error message. What am I missing here. Why can I not reference a uniquely named block item as a input variable to a function in a different block? Does Forms first figure out what it needs to retrieve and then executes the SQL for each block in isolation, or does the first block's result set get retrieved, then the second, third, etc. Based on the message i am getting I would suspect the former since it appears their is no value in subsequent blocks. If so is there anyway around this? thanks.

    Don't quite understand your problem completely. But this might help. I sure hope your Provider_Main is a single-record block ...otherwise, how would you supply a list of values of FCLTY and MEDICARE to the function that does the sorting? Be awere, too, that the order-by is processed by the server, and NOT by Forms.
    Assuming it is a single-record block, you can put the values into parameters:
    :Parameter.Fclty := :Provider_Main.Fclty;
    :Parameter.Medicare := :Provider.Medicare;
    Execute_Query;
    And your order-by clause would be
    get_vals( ''||:FCLTY_CM||'',''||:MEDICARE_CM||'',
    :Parameter.Fclty,
    :Parameter.Medicare) desc
    By the way, the first line of your order-by looks strange. Shouldn't it be:
    get_vals( FCLTY_CM || ',' || MEDICARE_CM,
    or even better, get_vals should take in 4 parameters:
    get_vals(Fclty_cm, Medicare_cm, :parameter.Fclty, :parameter.Medicare)

  • LOV usage -- Can LOV used as key-value pair?

    Post Author: phoenix
    CA Forum: WebIntelligence Reporting
    Hello,
    I am using BO XI R2 and I come to an issue with LOV. Can LOV be used as a key-value list?
    Say I have a key-value list as below:
    A --> 1
    B --> 2
    Can LOV just list 'A, B.. ' and return 1 if user choose A and 2 if user choose B?
    Many thanks.
    phoenix

    It is possible only if you know all possible KEY values:
    with t as (
               select 1 id,'STATUS' key,'TRUE' val from dual union all
               select 1,'AGE GROUP','10' from dual union all
               select 1,'TRAVEL','Y' from dual union all
               select 2,'STATUS','FALSE' from dual union all
               select 2,'AGE GROUP','20' from dual union all
               select 2,'TRAVEL','N' from dual
    select  id,
            max(case key when 'STATUS' then val end) status,
            max(case key when 'AGE' then val end) age,
            max(case key when 'AGE GROUP' then val end) "AGE GROUP",
            max(case key when 'TRAVEL' then val end) travel
      from  t
      group by id
            ID STATUS AGE   AGE GROUP TRAVEL
             1 TRUE         10        Y
             2 FALSE        20        N
    SQL> If you are on 11g, you can use PIVOT construct, but again you need to know resulting columns upfront.
    Another thing you could do is to return a CSV list of key all values in one column using STRAGG (or LISTAGG if you are on 11.2), hierarchical queries, XML or undocumented WM_CONCAT.
    SY.

  • SCCM Query to Find Registry Key Value That is IP Address

    I am try to create a collection that will show all computers with the following registry value:
    [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\SNMP\Parameters\TrapConfiguration\mesnet]
    "1"="10.213.11.221"
    Does anyone know how to create the query?  Ive already updated the mof files on SCCM.  Thanks.

    This is what I entered in the Config.mof file:
    // RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich & Kent Agerlund)
    // this section tells the inventory agent what to collect
    // 9/25/2012 9:20:39 AM
    #pragma namespace ("\\\\.\\root\\cimv2")
    #pragma deleteclass("mesnet", NOFAIL)
    [DYNPROPS]
    Class mesnet
    [key] string KeyName;
    String 1;
    [DYNPROPS]
    Instance of mesnet
    KeyName="RegKeyToMOF_32";
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\services\\SNMP\\Parameters\\TrapConfiguration\\mesnet|1"),Dynamic,Provider("RegPropProv")] 1;
    #pragma namespace ("\\\\.\\root\\cimv2")
    #pragma deleteclass("mesnet_64", NOFAIL)
    [DYNPROPS]
    Class mesnet_64
    [key] string KeyName;
    String 1;
    [DYNPROPS]
    Instance of mesnet_64
    KeyName="RegKeyToMOF_64";
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\services\\SNMP\\Parameters\\TrapConfiguration\\mesnet|1"),Dynamic,Provider("RegPropProv")] 1;
    This is what I added to the sms_def.mof file:
    // RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich & Kent Agerlund)
    // this section tells the inventory agent what to report to the server
    // 9/25/2012 9:20:39 AM
    #pragma namespace ("\\\\.\\root\\cimv2\\SMS")
    #pragma deleteclass("mesnet", NOFAIL)
    [SMS_Report(TRUE),SMS_Group_Name("mesnet"),SMS_Class_ID("Custom|mesnet|1.0"),
    SMS_Context_1("__ProviderArchitecture=32|uint32"),
    SMS_Context_2("__RequiredArchitecture=true|boolean")]
    Class mesnet: SMS_Class_Template
    [SMS_Report(TRUE),key] string KeyName;
    [SMS_Report(TRUE)] String 1;
    #pragma namespace ("\\\\.\\root\\cimv2\\SMS")
    #pragma deleteclass("mesnet_64", NOFAIL)
    [SMS_Report(TRUE),SMS_Group_Name("mesnet"),SMS_Class_ID("Custom|mesnet|1.0"),
    SMS_Context_1("__ProviderArchitecture=64|uint32"),
    SMS_Context_2("__RequiredArchitecture=true|boolean")]
    Class mesnet_64 : SMS_Class_Template
    [SMS_Report(TRUE),key] string KeyName;
    [SMS_Report(TRUE)] String 1;
    I'd like to gather a report on computers that do not have this setting.  Once I identify those computers that need this config, i plan on pushing out a package so that they are properly configured. 

  • Query regarding using multiple physical sources

    Hi All,
    Facing an issue in fetching data from multiple physical sources in OBIEE,
    We have 2 facts tables on different databases, having same columns.
    How can we get results from both the tables in the presentation layer.
    I created one Logical Fact table, added both sources to it, but results are displayed only from logical source which i added first.
    OBIEE version:
    10.1.3
    OS Windows
    Thanks,
    Nik

    Hi Nikhil,
    If you have identical columns in both the sources, obiee will always choose only one LTS .To understand how to force multiple LTSs in query, check this thread:
    2 table sources in LTS but only 1 in query?
    Regards,
    Dpka

  • How to set aggregation rule (SUM) to a query which uses multiple tables

    Hi,
    I have a doubt like i have a query .i want to get the sum of few columns in that..how can i achieve it as it joins multiple tables . i am posting the query under this. please help me to resolve this. i need to get summation of column which is marked in bold . i am so sorry to post such a big query.. thanks in advance.
    SELECT DISTINCT
        SAS.ACCOUNT_MONTH_NO,
        SAS.BILL_TO_MAJOR_SALES_CHANNEL,
        SAS.BUS_AREA_ID,
        SAS.CUST_NAME,
        SAS.PART_NO,
        SAS.PART_DESC,
        SAS.PRODUCT_CLASS_CODE,
        SAS.SUPER_FAMILY_CODE,
        *SAS.NET_SALES_AMT_COA_CURR,* 
      *SAS.GROSS_SALES_AMT_COA_CURR*,
        *SAS.SHIPPED_QTY*,
        SAS.SRCE_SYS_ID,
        GWS.SRC_LOCATION,
        GWS.PART_CF_PART_NUMBER,
        GWS.ANALYST_COMMENTS,
        NVL(GWS.CLAIM_QUANTITY,0) AS *CLAIM_QUANTITY*,
        GWS.CUSTOMER_CLAIM_SUBMISSION_DATE,
        GWS.CLAIM_TYPE,
        GWS.CREDIT_MEMO_NO,
        NVL(GWS.CREDIT_MEMO_AMT,0) AS *CREDIT_MEMO_AMT*,
        GWS.TRANS_CREATED_BY,
        GWS.COMPONENT_CODE,
        GWS.DATE_OF_THE_FAILURE,
        GWS.DATE_PART_IN_SERVICE,
        GWS.PROBLEM_CODE,
        NVL(GWS.TOT_AMT_REVIEWED_BY_CA,0) AS *TOT_AMT_REVIEWED_BY_CA*,
        GWS.REGION
      FROM
    SELECT
            TO_CHAR(A.STATUS_DATE, 'YYYYMM') AS ACCOUNT_MONTH_NO,
            A.LOCATION_ID SRC_LOCATION,
            A.CF_PN PART_CF_PART_NUMBER,
            A.ANALYST_COMMENTS,
            A.CLAIM_QUANTITY, 
         A.CUST_CLAIM_SUBM_DATE CUSTOMER_CLAIM_SUBMISSION_DATE,
            A.CLAIM_TYPE,
            A.CREDIT_MEMO_NO,
            A.CREDIT_MEMO_AMT,
            A.CREATED_BY TRANS_CREATED_BY,
            A.FAULT_CODE COMPONENT_CODE,
            A.PART_FAILURE_DATE DATE_OF_THE_FAILURE,
            A.PART_IN_SERVICE_DATE DATE_PART_IN_SERVICE,
            A.FAULT_CODE PROBLEM_CODE,
            A.TOT_AMT_REVIEWED_BY_CA,
            A.PART_BUS_AREA_ID AS BUS_AREA_ID,
            A.PART_SRC_SYS_ID,
            C.CUST_NAME,
            C.BILL_TO_MAJOR_SALES_CHANNEL,
            P.PART_NO,
            P.PART_DESC,
            P.PRODUCT_CLASS_CODE,
            L.REGION
          FROM
            EDWOWN.MEDW_BIS_DTL_FACT A,
            EDWOWN.EDW_MV_DB_CUST_DIM C,
            EDWOWN.EDW_BUSINESS_LOCATION_DIM L,
            EDWOWN.EDW_V_ACTV_PART_DIM P
          WHERE
            A.PART_KEY                       = P.PART_KEY
          AND A.CUSTOMER_KEY                 = C.CUSTOMER_KEY
          AND A.LOCATION_KEY                 = L.LOCATION_KEY
          AND A.PART_SRC_SYS_ID              = 'SOMS'
          AND A.PART_BUS_AREA_ID             = 'USA'
          AND C.BILL_TO_MAJOR_SALES_CHANNEL <> 'IN'
        GWS,
          SELECT
            A.ACCOUNT_MONTH_NO,
            A.BUS_AREA_ID,
            A.NET_SALES_AMT_COA_CURR,
            A.GROSS_SALES_AMT_COA_CURR,
            A.SHIPPED_QTY,
            B.BILL_TO_MAJOR_SALES_CHANNEL,
            A.SRCE_SYS_ID,
            B.CUST_NAME,
            D.PART_NO,
            D.PART_DESC,
            D.PRODUCT_CLASS_CODE,
            D.SUPER_FAMILY_CODE
          FROM
            SASOWN.SAS_V_CORP_SHIP_FACT A,
            SASOWN.SAS_V_CORP_CUST_DIM B,
            SASOWN.SAS_V_CORP_LOCN_DIM C,
            SASOWN.SAS_V_CORP_PART_DIM D
          WHERE
                C.DIVISION_CODE = A.DIVISION_CODE
            AND
                B.B_HIERARCHY_KEY = A.B_HIERARCHY_KEY
            AND
                D.PART_NO = A.PART_NO
            AND
                A.SRCE_SYS_ID = 'SOMS'
            AND
                A.BUS_AREA_ID = 'USA'
            AND
                B.BILL_TO_MAJOR_SALES_CHANNEL <> 'IN'
        SAS
      WHERE
        SAS.ACCOUNT_MONTH_NO              = GWS.ACCOUNT_MONTH_NO(+)
      AND SAS.BILL_TO_MAJOR_SALES_CHANNEL = GWS.BILL_TO_MAJOR_SALES_CHANNEL(+)
      AND SAS.BUS_AREA_ID                 = GWS.BUS_AREA_ID(+)
      AND SAS.PRODUCT_CLASS_CODE          = GWS.PRODUCT_CLASS_CODE(+);thanks in advance
    aswin

    You get rid of the distinct.
    You put sum() around your starred items.
    You put all the remaining columns in a GROUP BY clause.
    You hope that that none of the other tables has more than one row that matches the SAS table, which would cause you to count that row more than once.

  • How to query berkeley db with multiple keys

    Hi all,
    Is there a way to query a berkeleydb using multiple keys. For example, I want to query a order record with orderID and orderDirection, orderID is a string and orderDirection is a char.
    Is there a way to do so?
    Regards,
    -Bruce

    Hi Bruce,
    Yes, you would use the same approach with a join cursor.
    Here is a simple example, simplified for brevity. Suppose the primary database "books" stores information about books, and that these books could have multiple authors. Following is some example data and the structure of these databases:
    books.db (primary db -- ISBN is primary key)
    isbn_1 | {author_1, author_2; ...}
    isbn_2 | {author_2; ...}
    isbn_3 | {author_1, author_3; ...}
    booksAuthors.db (secondary db -- author is the secondary key, the secondary key extractor generates multiple keys)
    author_1 | isbn_1
    author_1 | isbn_3
    author_2 | isbn_1
    author_2 | isbn_2
    author_3 | isbn_3
    To get the books authored by author_1 and author_2 for example, you would do the following:
    - position a cursor in the booksAuthors.db secondary db, using DBcursor->get() with the DB_SET flag, on the records whose key (secondary key) is author_1;
    The cursor will be positioned on the duplicates list for author_1:
    author_1 | isbn_1
    author_1 | isbn_3
    - position a cursor in the booksAuthors.db secondary db, using DBcursor->get() with the DB_SET flag, on the records whose key (secondary key) is author_2, hence duplicates list for author_2:
    author_2 | isbn_1
    author_2 | isbn_2
    - create a join cursor using DB->join, using the previous two cursors.
    An excerpt from the above documentation page explains the way a join cursor works:
    "Joined values are retrieved by doing a sequential iteration over the first cursor in the curslist parameter, and a nested iteration over each secondary cursor in the order they are specified in the curslist parameter. This requires database traversals to search for the current datum in all the cursors after the first."
    Hence, the data item (primary key from the primary db) that results is isbn_1.
    Regards,
    Andrei

  • How to set a default value in my DropDown using the key  ?

    Hello All,
      Can someone advose how I can achieve the above ? I will like to know how to select a default value for the dropdown by key using the key value instead of description.
      The reason why I need to do so instead o fusing description is because my application will populate the dropdown using web services based on the language selection. Hence, if I were to set the default value using description, den other languages will not work anymore.
      Any help will be greatly appreciated. Thank you !!
    from
    KWok Wei

    Kwok,
    Assuming that:
    1. You have a node NodeX, where attribute TargetAttr defined
    2. You have a DropDownByKey UI control, its property selectedKey bound to NodeX.TargetAttr attribute
    Then:
    Place in your code:
    wdContext.currentNodeXElement().setTargetAttr("yourKey");
    VS
    P.S. This topic was raised several times, and forum search works good enough to find an answer

  • How to pass multiple filter values in SAPBEXsetFilterValue function

    I am using SAPBEXsetFilterValue for filtering the query. I want to have multiple filters for same key value for ex. for plant I want the query to be filtered for two plants at the same time using this function please any one could help me out

    Hi,
    Afraid, that is not possible:
    Re: Setting Multiple Filter Values or Filter Range Using SAPBEX API?
    Re: Passing a range to SAPBEX.XLA!SAPBEXSetFilterValue
    Re: SAPBEXsetFilterValue
    Best regards,
    Eugene

  • Multiple Available Values in Parameter

    I have a query like Select * from Table where column in (@Parameter)
    @Parameter has two choices. 
    Choice 1 value is 01 or 05. Choice 2 value is 04 or 06.
    If Choice 1 is selected for the parameter, I want the query to result into Select * from Table where column in (01, 05).  This should show results for rows where Column is either 01 or 05.  "Column" is a text data type.
    How do I use multiple available values in a parameter?  I found this post
    http://social.msdn.microsoft.com/Forums/en-US/a484ceb0-78f8-472e-ae96-d48f85ea25b7/multiple-values-in-available-values-non-query-in-report-parameter-in-ssrs?forum=sqlreportingservices but that is not working for me.  I tried to put 01 and 05 (no double
    quotes) on different lines in the parameter available values expression box but I still get no results.  My parameter is a data type of text and is not multi value.
    If I change my available value to 01 I get correct results
    I'm really stuck.  I hope someone can help me.
    Milissa Hartwell

    Hi Milissa,
    In order to achieve your requirement, I suggest that you should add another parameter named parameter1 in your report. For more details, please see:
    Modify the query like below:
    Select * from Table where column in (@Parameter1)
    Add another parameter named Parameter1 with ‘Allow multiple values’ option in the report.
    Select Hidden as the parameter visibility.
    Specify the values below in the Available values:
    Label: 1                                            
    Value: =iif(Parameters!Parameter.Value=1,”01”,”04”)
    Label: 2                                            
    Value: =iif(Parameters!Parameter.Value=1,”05”,”06”) 
    Specify the values below as the Default Values:
    Value: =iif(Parameters!Parameter.Value=1,”01”,”04”)
              =iif(Parameters!Parameter.Value=1,”05”,”06”)
    Then when you select 1 as the choice of Parameter, it will directly affect the result into Select * from Table where column in (01, 05). When you select 2 as the choice of Parameter, it will directly affect the result into Select * from Table where column
    in (04, 06). 
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • Mail won't appear in inbox

    Hello, I have an issue with mail. I've upgreated to mountain Lion yesterday and I've decided to give a try to Icloud. But eversince I have a problem with mail. The issue is that when I get an email, it doesn't appear. I have the sound but the little

  • "Can't establish a secure connection to server" Ne...

    Since moving to BT on 22nd Oct none of my Apple devices, laptop, phone or desktop are able to access Dropbox, iCal (cloud synced calander) or iCloud (Apple's cloud service). I get a message that "a secure connection to the server could not be establi

  • Debugging incoming SQL

    I am trying to capture SQL query being submitted to the Oracle Server (8i) being sent by a C++ program. Any ideas on how to get the information from Oracle? Any hint will be appreciated. null

  • ExecuteWithParams not working in ADF BC SRDemo Tutorial

    Hi I have created View Objects with the Named Variable TheStatus as per the ADF BC Tutorial If i Open the SRList page and try to click on the Command Links for Open, Closed or Pending statuses the Results are not being filtered based on ExecuteWithPa

  • Yahoo email account synchronisation on mac mini

    Hi I have been struggling to get my yahoo email account on my mac mini I can get the email on my iPad it did work on my mac mini. But now it does not... any ideas.?.. Thanks