Group By condition in result package

Hi Experts,
I have a requirement, where I need to write a logic to populate few key figures of a Cube.
Logic is based on Group by condition on 3 fields of the result package. (Need to implement in end routine)
Is there any way that I can do a select statement on the result package fields and then put a group by clause to get my aggregated data.
I need to fill up the key figures in the cube itself (cant take it to BEx).
Please let me know how to proceed for it.
Thanks
El.

Githen, Thanks for the reply.
I am thinking of another option of implementing it. Let me know your thoughts
There is a DSO on the top of this Cube, If I use all the fields which I want to use in "Group By" condition as key fields of the DSO.
Then would it automatically aggreagate the rows based on the conditions? Will it suffice the requirement?
Thanks
El.

Similar Messages

  • Oracle BI Answers Problem Using Group By condition.

    Hi All,
    I'm new to Oracle BI. i have a requirment to count the number of opened request and number of closed request(month wise) from a table which have fallowing columns:
    Date logged(Date) Status(character) Date closed(date)
    8/12/2008 open null
    8/19/2008 closed 8/21/2008
    I also neeed the total closed request for a particular month irrespective of the opened month.( eg. if a request was raised in Apr and was closed in Aug shoulb be counted.)
    For this requirment i modified the select query:
    SELECT new_event.Month saw_0, new_event.opened saw_1, new_event.closed saw_2, new_event.Cmonth saw_3 FROM
    (SELECT MONTHNAME(Events."Logged Date/time") as MONTH , COUNT(Events.Status) as opened,0 as closed,0 as Cmonth FROM Incidents WHERE ("Assigned Service Dept"."Assigned SVD" = 'WHG DSG SUPPORT') AND (Events.Status IN ('Open', 'Closed')) GROUP BY MONTHNAME(Events."Logged Date/time")
    UNION
    SELECT MONTHNAME(Events."Logged Date/time") as MONTH ,0 as Opened, COUNT(Events.Status) as closed,0 as Cmonth FROM Incidents WHERE ("Assigned Service Dept"."Assigned SVD" = 'WHG DSG SUPPORT') AND Events.Status = 'Closed' GROUP BY MONTHNAME(Events."Logged Date/time")
    UNION
    SELECT MONTHNAME(Events."Closure Date") as MONTH ,0 as Opened,0 as closed, COUNT(Events.Status) as Cmonth FROM Incidents WHERE ("Assigned Service Dept"."Assigned SVD" = 'WHG DSG SUPPORT') AND Events.Status = 'Closed' GROUP BY MONTHNAME(Events."Closure Date")) new_event
    ORDER BY saw_0, saw_2, saw_3
    Using This query i'm able to get the fallowing result set.
    Month opened closed Cmonth
    Apr 25 0 0
    0 0 27
    0 25 0
    Aug 27 0 0
    0 0 21
    0 10 0
    So I want to do a group by month and sum of closed, opened and cmonth column.
    But when i add the group by condition i'm getting the error as "GROUP BY Condition Needed"
    Thanks,
    Sumit

    Ignore the SQL let Analytics handle that for you, the key here is to get your model correct.
    You need a Time Dimension (ie. a table full of calendar dates) which you join to your Fact table date columns in the Physical layer.
    In the logical layer fact table you should have two columns #Open and # Closed - these will be based on a case condition sum aggregate ie.
    No. Open
    CASE WHEN closed_date IS NULL THEN 1
    ELSE 0
    END
    No. Closed
    CASE WHEN closed_date IS NOT NULL THEN 1
    ELSE 0
    END
    If you then make sure you join your Time Dimension (create an alias for each instance) to the open and closed dates you'll be able to have a count of the items closed by Year/Month/Week/Date etc...

  • End Routine Result Package Output not as expected

    I have written an end routine that is based on a one to one mapping of two DSOs A to B, i calculate the value of two key figures which populate the fields, keyfig1 (a total of the amt_field per order) and keyfig2 (a % of the amt_field of keyfig1) .
    My problems is I seem unable to modify my output result package and keep getting no output  result on both key figures keyfig1 and keyfig 2. However my amt_field has changed instead! I want that to remain unchanged. This is my routine is below:
    data: wa_result_package TYPE tys_TG_1.
    types : begin of itabtype,
                     order         type    /BI0/OI_order_field,
                     tot_amt      type     /BIC/OIamt_field,
               end of itabtype.
               data : itab type standard table of itabtype,
                     wa_itab like line of itab.
    sort RESULT_PACKAGE by order_field   ascending.
    clear wa_itab.
    loop at RESULT_PACKAGE into wa_RESULT_PACKAGE.
               At End of order_field.
                      wa_itab-order    = wa_result_package-order_field.
                      wa_itab-tot_amt = wa_itab-tot_amt +
                      wa_result_package-/BIC/amt_field
                       append wa_itab to itab.
               ENDAT.
        wa_itab-order    = wa_result_package-order_field.
        wa_itab-tot_amt = wa_itab-tot_amt + wa_result_package-/BIC/amt_field
    endloop.
    loop at RESULT_PACKAGE into wa_RESULT_PACKAGE.
             read table itab into wa_itab
                         with key order = wa_result_package-order_field.
             if sy-subrc = 0.
                        wa_result_package-/BIC/keyfig1  = wa_itab-tot_amt.
              endif.
    If wa_result_package-/BIC/keyfig1 <> 0.
               wa_result_package-/BIC/keyfig2 =
               wa_result_package-/BIC/amt_field /
               wa_result_package-/BIC/keyfig1* 100.
    else.  wa_result_package-/BIC/keyfig2 = 0.
    endif.
    modify RESULT_PACKAGE from wa_RESULT_PACKAGE transporting /BIC/keyfig1 /BIC/keyfig2.
    endloop.
    Any help will be most appreciated. Thanks in advance.

    Hi,
    Besides the Endroutine tab there is another tab.
    Update fields even if no rule is assigned.
    Have you checked that? If not you will always get initial, for the fields you are updating.

  • Material Fright Group related Condition record is not captured in billing

    Dear all,
       As i am creating Credit Memo with respect to Credit memo Request (Sales Order) and my freight condition record is maintained in Material Freight Group level. This field is there in Sales Order but when i am creating Credit memo it is not captured and also i am unable to find Material Freight Group field in Billing Document.
    Please help urgently.
    Regards,
    Chirag Pedhadiya.

    Hi...
          But why we have to write this code in User Exit. Is this Standard SAP Problem ??
    I just wonder that in Delivery Related Billing Document it is finding Material Freight Group related Condition record in Billing means in Billing Pricing it is getting value in Material Freight Group filed and set this condition record value, though there is no any field like MFRGR (Material Freight group) in Billing Tables VBRK or VBRP.
    So for Order related Billing Document only why this filed is not getting any value in Pricing ??
    Thnaks,
    Chirag  Pedhadiya.

  • How to set required for group of condition type in the same condition class

    Hello,
              we have a group of condition type with the same condition class B, the last one have been set, and all of others will be inactive.
    but we don't set any required for all the condition types in pricing control, so if user don't set any of them, the sales order or billing is still saved. that is a risk.How can i fix it? Thanks.
    Sophie

    Hello,
      incompletion log is not available in invoices.
    You have different options:
    - activate a validation in FI when the Billing document is released into accounting,  so that te release into accounting is not allowed if the invoice amount is zero;
    - define a subtotal in the pricing procedure as sum of the pricing conditions of your group, then develop a custom routine to be assigned in the formula "CalType" (field T683S-KOFRM) where an error should be raised if the amount of the subtotal is zero (use as an example formula 48);
    Best regards,
    Andrea

  • Conditions for results row in query

    Hi,
    I've query with conditions. Let us say without conditions query result has 10 records. But After applying conditions result has 4 records.
    When you check the result row the subtotals and totals are coming wrong. Result rows are considering the 10 records.
    How can I get the result row has to consider only those 4 records after conditions.

    Hi,
    I have the same problem. And I didn't find any solution.
    kind regards
    Tobias

  • Multiple Groups of Conditions in Smart Mailboxes

    In Yosemite Mail is it possible to create more than one group of conditions for a smart mailbox?
    In iTunes, when creating smart playlists, you can press OPTION while clicking on the '+' sign to add conditions. A new group of conditions can be added.
    I do not see anything similar in Mail.
    Thanks,
    b.

    I think you miss the point.
    I'm looking to make a smart mailbox to show mail with
    (Condition A AND Condition B)
    OR
    (Condition A AND Condition C)
    OR
    (Condition X AND Condition Y)
    Thanks,
    b.

  • Using identy Group as condition

    Hi ,
    I wanna create a authorization Policy using two identity Group as condition . But i juste heve "OR " as operator for those two condition !!I wanna i use operator and is this Possible ???

    Configuring Policy Elements Conditions
    Cisco ISE provides a way to create conditions that are individual, reusable policy elements that can be referred from other rule-based policies. Whenever a policy is being evaluated, the conditions that comprise it are evaluated first.
    Under Policy > Policy Elements > Conditions, the initial Conditions pane displays the following policy
    element condition options: Authentication, Authorization, Profiling, Posture, Guest, and Common.
    Simple Conditions
    Simple Condition Format
    This type uses the form attribute operand value. Rule-based conditions are essentially a comparison of values (the attribute with its value), and these can be saved and reused in other rule-based policies. Simple conditions take the format of A operand B, where A can be any attribute from a Cisco ISE dictionary and B can be one of the values that attribute A can take.
    Compound Conditions
    Compound Condition Format
    Authorization policies can contain conditional requirements that combine one or more identity groups using a compound condition that includes authorization checks that can return one or more authorization profiles. This condition type comprises one or more simple conditions that use an AND or OR relationship. These are built on top of simple conditions and can be saved and reused in other rule-based policies. Compound Conditions can take any of the following forms:
    • (X operand Y) AND (A operand B) AND (X operand Z) AND ... (so on)
    • (X operand Y) OR (A operand B) OR (X operand Z) OR ... (so on)
    (*Where X and A are attributes from the Cisco ISE dictionary and can include username and device type.
    For example, compound conditions can take the following form:
    – DEVICE: Model Name Matches Catalyst6K AND Network Access: Use Case Equals Host
    Lookup.)
    Creating New Authorization Policy Element Conditions
    Use this procedure to create new authorization policy element conditions (simple or compound).
    To create new authorization policy element conditions, complete the following steps:
    Step 1 Click Policy > Policy Elements> Conditions > Authorization> Simple Conditions (or Compound
    Conditions).
    The Conditions page appears listing all existing configured authorization policy element conditions.
    Step 2 To create a new simple condition, click Create.
    The Simple Conditions page displays.
    Step 3 Enter values in the following fields to define a new simple condition:
    • Name—Enter the name of the simple condition.
    • Description—Enter the description of the simple condition.
    • Attribute—Click to choose a dictionary from the drop-down list of dictionary options, and choose an
    attribute from the corresponding attribute choices.
    • Operator—Enter Equals or Not Equals.
    • Value—Enter a value that matches the selected attribute.
    Step 4 Click Submit to save your changes to the Cisco ISE database and create this authorization condition.
    The Name, Attribute, Operator, and Value fields in simple conditions are required and are marked with an asterisk (*).
    For Complete Reference visit:
    http://www.cisco.com/en/US/docs/security/ise/1.0/user_guide/ise10_authz_polprfls.pdf

  • MPR testing is passed, but failed when upload Result Package to verify.

    Hi,
    I am attempting to certify our application using MPR-Test-Tool v4.6 for Windows Server 2012 R2.
    The MPR tool shows the testing Pass, and generated a .zip Result Package.
    But it's failed when uploads the .zip Result Package to verify in MPR web-site "Test My Apps" page, both Silver and Gold level are failed.
    In the "Test My Apps" page, I couldn't find the reason, error message or some hint for the failure.
    I am appreciate any help,
    Regards.
    Regards,

    Hello,
    Please check if you import the certificate into the Exchange server "Trusted Root Certificates".
    If there is a CA server in your domain, you also need to import your certificate into the trusted root certificates on the CA server.
    Cara Chen
    TechNet Community Support

  • If condition in a Package

    Hi all,
    I am new to ODI. I have got the following requirement.
    I have got two interfaces. 1. Daily Sales 2. Monthly Sales.
    My requirement is to execute the Daily Sales interface every day except the First Day of the Month. On the First Day of the month, Monthly Sales interface should be executed. And I have got two Global variables. 1. Present Day 2. First Day of the Month.
    I am planning to create a Package and my idea is if variable1 = variable2 then execute the Monthly Sales interface if not execute the Daily Sales interface...but I don't know how to do this using ODI.
    Can someone please help to me to achieve this? Thanks in advance.

    Yes we needs to call the same Variable twice in Refresh and Evaluate Mode. The refresh will always refresh and pick the latest value and Evaluate check the condition . If we don't do refresh then evaluate will pick the last stored value and give us wrong results.
    Now in order to handle the Yearly Sales , the method is similar to what i have suggested earlier.
    Step 1. Create a Variable ( GET_YR_FRST_DY) and paste the following code
    SELECT TO_CHAR(SYSDATE,'DDMM') FROM DUAL Step 2. Drag and Drop the Variable ( GET_YR_FRST_DY) in Refresh
    Step 3 . Drag and Drop the Variable ( GET_YR_FRST_DY) in Evaluate
    Operator = 0101
    Step 4 . If true (OK) then Yearly Sales
    Step 5. join Daily Sales and Monthly sales both to Step 2 (i.e GET_YR_FRST_DY) Refresh . This way you can handle all of them in one single package.
    Please let me know if you have any question.

  • Help: Group By condition

    Hello folks am actually trying to figure whether we can use the following condition i.e "to_char(sysdate, 'FMMon YYYY')," in the group by clause, Or can we use the alias "Period" instead,Can anyone please throw some light on this.
    SELECT Client. Client Name,
    "CUBS SNAPSHOT". HMG Flag,
    select TRUNC (SYSDATE, 'MONTH') - 1 from dual AS PeriodThruDate,
    select to_char(sysdate, 'FMMon YYYY') from dual AS Period
    FROM "CUBS SNAPSHOT", Client
    GROUP BY Client. Client Name,
    "CUBS SNAPSHOT".CLIENT,
    "CUBS SNAPSHOT".TYPE,
    "CUBS SNAPSHOT".clipStatus,
    "CUBS SNAPSHOT".SUBTYPE,
    to_char(sysdate, 'FMMon YYYY'),
    "CUBS SNAPSHOT". HMG Flag,
    TRUNC (SYSDATE, 'MONTH') - 1
    Thanks

    Hi,
    As you may have noticed, this site normally compresses white-space.
    To post formatted text (and code should always be formatted), type these 6 characters:
    &#123;code&#125;
    (small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
    SYSDATE is treated as a constant in GROUP BY queries.
    You can have constants in the GROUP BY clause if you really want to, but there's no point. If you have a GROUP BY clause anyway, adding constants to it won't change the results.
    You can't use a column alias in the GROUP BY clause of the same query where it was defined.
    I think the following is syntactically correct:
    SELECT    Client.Client          Name,
           "CUBS SNAPSHOT".HMG     Flag,
           ( select  TRUNC (SYSDATE, 'MONTH') - 1
             from       dual
           )               AS PeriodThruDate,
           ( select  to_char (sysdate, 'FMMon YYYY')
             from       dual
           )               AS Period
    FROM        "CUBS SNAPSHOT",
           Client
    GROUP BY  Client.Client,
                 "CUBS SNAPSHOT".CLIENT,
           "CUBS SNAPSHOT".TYPE,
           "CUBS SNAPSHOT".clipStatus,
           "CUBS SNAPSHOT".SUBTYPE,
           to_char(sysdate, 'FMMon YYYY'),          -- Why?
           "CUBS SNAPSHOT".HMG,
           TRUNC (SYSDATE, 'MONTH') - 1               -- Why?
    ;Scalar-sub-queries (like PeriodThruDate and Period) must be enclosed in parentheses. You don't have to use a sub-query in these two cases. Instead of
    ( select  TRUNC (SYSDATE, 'MONTH') - 1
      from       dual
    )                    AS PeriodThruDate,you could say:
    TRUNC (SYSDATE, 'MONTH') - 1      AS PeriodThruDate,The query above is doing a cross-join betwee the two tables. That's not necessarily an error, but it almost certainly isn't what you want. Every table in the FROM clause is usually referenced in at least one join condition.
    I suggest writing much smaller queries, and adding to them one or two lines at a time. You'll find it much easier to locate and fix mistakes that way.
    That is, don't wite 14 lines of code and then try to run it.
    Write maybe 2 lines. Test it, and make corrections as necessary.
    When it does what it's supposed to dio perfectly, add another line or two and test again.

  • Group Policy - Issues deploying software packages through GPO

    Hello everyone,
    I am having issues successfully deploying MSI packages through group policy.  I have set my computer account up in its own test OU in my domain, but yet the software will not deploy.  Example, I'm trying to deploy AVG Anti-Virus and make sure it
    is installed on each and every PC in my domain.  As for the GPO, I set it up as an assigned package and pointed to the location of the package with the UNC file path (visible to both the DC and my computer that is part of the affected OU)
    On the domain controller, I get these messages in application event logs:
    Beginning a Windows Installer transaction: \\hs-dc2\software\avg\installavg.msi. Client Process Id: 9048.
    Ending a Windows Installer transaction: \\hs-dc2\software\avg\installavg.msi. Client Process Id: 9048.
    This shows up when I refresh GP on my computer.  I run gpresult /h GPReport.html and get the following message:
    Software Installation failed due to the error listed below.
    Fatal error during installation.
    Additional information may have been logged. Review the Policy Events tab in the console or the application event log for events between
    The software is in a share on the domain controller that is visible from my computer, and permissions are set where "Everyone" has read access.  I have tested the package on my computer and it installs
    correctly if I do it manually, so it's a good package. 
    I'm at a loss.  I am admitedly very new to GP management, but I'm pretty sure I have covered all my bases here.  I humbly ask for any and all help that you all can provide.
    Thank you all very much, have a great weekend!

    > Magnolia_Schools.exe
    What's that???
    > \\hs-dc2\software\avg\installavg.msi
    > <file://\\hs-dc2\software\avg\installavg.msi> /qb addeploy=1
    /qb ADDEPLOY=1
    Uppercase matters (:
    A bissle "Experience", a bissle GMV... Wenn meine Antwort hilfreich war, freue ich mich über eine Bewertung! If my answer was helpful, I'm glad about a rating!
    I should have explained, my apologies.  The InstallAVG.msi is the package I have GP deploying.  it is a package that AVG wrote for us that goes in, uninstalls the two previous antivirus softwares we have on our network if it is present, and
    then wraps it to run magnolia_schools.exe which installs the AV software.  I am uninstalling AVG now and will try reinstalling with
    \\hs-dc2\software\avg\installavg.msi /qb ADDEPLOY=1 and report back.
    also, the only logs I found that were around the time of the install attempt were such as these:
    1: 2905 2: C:\windows\system32\appmgmt\MACHINE\{06ee0d46-cd5f-4216-a09f-2aeb573aa5ba}.aas
    1: 2905 2: C:\windows\system32\appmgmt\MACHINE\{06ee0d46-cd5f-4216-a09f-2aeb573aa5ba}.aas
    Does that tell you anything?
    I will say this, if this means anything...now that AVG is installed, the event logs are changing from an error %%1603 to this:
    Failed to apply changes to software installation settings. The installation of software deployed through Group Policy for this user has been delayed until the next logon because the changes must be applied before the user logon. The error was : %%1274
    The removal of the assignment of application exe2msiSetupPackage from policy Install AVG failed. The error was : %%2
    So it acts like it's at least seeing that the package is installed...and reacting differently, correct?
    Thanks so much

  • Group by Lookup function result

    I have a report that uses two datasets.
    The first one looks like this. It's the time members have recorded under a particular job title:
    ParentId TaskName ObjectiveId MemberId JobTitle TimeSpent Status
    3174ED19 TEST 3 42AA79F6 23179C0F NULL 0.00 01
    3174ED19 TEST 3 42AA79F6 596CA495 JobTitle1 9.00 01
    3174ED19 TEST 1 AEE18C46 23179C0F NULL 0.00 01
    3174ED19 TEST 1 AEE18C46 596CA495 JobTitle2 3.00 01
    3174ED19 TEST 2 AEE18C46 23179C0F NULL 0.00 01
    3174ED19 TEST 2 AEE18C46 596CA495 6.00 01
    I need to show the records which have JobTitle == null with a particular Job Title, the current one they have in Active Directory. So I use another dataset from a WCF service:
    MemberId Name JobTitle
    23179C0F Member1 JobTitle1
    Then I use a lookup function to show the correct Job Title:
    =IIF(IsNothing(Fields!JobTitle.Value) OR Fields!JobTitle.Value = "",lookup(Fields!MemberId.Value,Fields!MemberId.Value,Fields!JobTitle.Value,"Members"),Fields!JobTitle.Value)
    This works ok. The problem is that I need the data to be grouped by several fields, including the Job Title. It seems grouping happens before the lookup function is executed, so instead of grouping the NULL values along with the fields that contains the actual
    values, I end up with two groups with the same Job Title, one containing the null values and another with the actual values.
    Is there any workaround for this?
    Thanks.

    Hi EXR88,
    Per my understanding that you have add some row group in the report to group the result which include the JobTitle from the table1 and also group by the field which result comes from the lookup funtion, now the issue is the group by the Lookup function result
    isn't correct, right?
    I have tested on my local envoronment and can't reproduce the issue, please find the details information below to make sure you have done the correct setting:
    I tried to create the two tables like below:
    Table1:
     Have the same recores as you provided above.
    Table2:
    MemberId    Name      JobTitle
    23179C0F   Member1    JobTitle1
    596CA495   Member1      NULL
    After adding the LookUP function, i got the report like below:
    I add two row group base on the JobTitle(JobTitle) and the Lookup functiuon result(Lookupfunctiongroup), the Lookupfunctiongroup row group is the child group of the JobTitle like below, please make sure you have add the expression with the lookupfunction
    in the group on:
    If i have some misunderstanding, please try to provide the expectted group by  result you want to get and also the currectly result you have got.
    Any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • How do I create package groups from a set of packages?

    Hello,
    Suppose I have a set of packages to be grouped together so that I can do
    pacman -S <pkg_group_name>
    to install all the packages in that group, how do I do this?
    Thanks for your help,
    Anand

    groups=('pkg_group_name')
    in the PKGBUILDS.
    man makepkg, for future ref.

  • Query with a condition - Overall results row is wrong

    Hello,
    I have a query that uses a condition.  The query gives me the top 10 brands according to the Net Sales.  The query itself runs fine.  I just noticed however that the Overall Result row isn't giving me the correct number.
    For example:
    <b>BRAND            NETSALES    MARGIN %</b>
    Brand1           $100        25%
    Brand2           $60         10%
    Brand3           $20         15%
    <b>OVERALL RESULT   $210        2%</b>
    As you can see it does not add up or average correctly.  This query has no macros or anything, it only uses a condition.
    Any suggestions?
    Thanks,
    Nick

    A workaround I have found is the manual directions in this OSS note: 572910
    Anyone have any follow up?
    Thanks.
    Nick

Maybe you are looking for

  • How do I move a file up one directory?

    While in "icon view", how can i select a file and then move it up one directory? I always end up dragging it to the desktop, then navigating my way up one directory in finder, then dragging it from desktop to the one directory higher. Seems like a lo

  • Custom options in Adobe PDF printer are not showing up in "Default Settings"

    Hello, I am using Windows 7 and I am trying to create custom "Default Settings" in my Adobe PDF printer. When I make edits to an existing setting, click "Save As..." and save with a new filename, the new settings are not showing up in the "Default Se

  • Can't put files into nested folders in dock

    Whenever I try to put a file into a folder I have in my dock, it will only let me put it in the first level of the folder. Ideally, I would want the folder to pop open and show the next level of folders so I can navigate through levels of nested fold

  • Sql developer with compute function/ add total to column.

    Hello experts i've been strugglin for a couple of hours on this. and im not sure if this is the forum i should be posting this but i could not found a forum directly related to sql developer. I would like to use the compute function in sql developer

  • How can i use a voice recording as ringtone?

    Cant figure iut how to do it or find instructions. any ideas if its possible? Any advice appreciated. Thanks!