Group By in Calculation

Could somebody let me know if it is possible to use group by in a discoverer calculation?

Hi
Well if you can re-create or get hold of the SQL you can always put it into a View or Custom folder. In these cases, you can use a GROUP BY within your code.
For complex pieces of SQL my preference would be to go with either a View, in where I can add optimizer hints, or ultimately go for a materialized view. Seeing as you are talking about having some predefined calculations, I would seriously consider using a materialized view using an optimzed view as the driver.
I hope this helps
Best wishes
Michael Armstrong-Smith
URL: http://learndiscoverer.com
Blog: http://learndiscoverer.blogspot.com

Similar Messages

  • Shipment Cost: Group Condition Type calculated on a special weight...

    Here is the scenario: A shipment (truck) combines multiple deliveries, grouped on a stage when same destination (happens often).
    A condition per LB is to be calculated on the cumulated weight per destination (per stage) BUT not simply on the gross weight, but on the heavier of 2 special weights: the business here uses a special formula according to the packaging, and it gives 2 weights (stored in Z fields of LIKP), an actual weight and a cubic weight.
    The purpose is to identify for each delivery the heavier weight and to use cumulated the weight across the deliveries to the same destination to calculate the per CWT cost.
    This is my first issue: the condition type is defined at Delivery calculation base, Calculation Type Multi-dimensional, and as a group condition). How do I define to use the cumulated of each delivery heavier weight ? In the Scale for condition type view, I used the scale basis D Gross Weight (which is not right..), there is also a field for a Scale Base Value formula, I wondered if that is what I should use..
    My 2d issue: once the cost is calculated, I have to re-distribute it on the deliveries as per the proportion of their heavier weight compared to the total weight used for the calculation…Should that be an alternate Condition Base Value formula in the pricing procedure (where xkwert would be….the heavier weight….would that be then a new Z field to be filled in by the user exit determing the heavier value) ??
    Thanks a lot, it is a tough one, I know...who is the best ever shipment cost pricing consultant ? !

    Hi Guys
    Unfortunately I do not think that you will get an answer now. Either your question is not simple or we do not know.
    So in the interest of keeping the Forum tidy and easier to surf through could you please close your thread and either try one of the other forums or try another post. I do not think that most people will bother to look this far back anymore.
    Sorry I cannot help as I would if I could.
    Regards
    Frenchy.

  • Group By on Calculated Columns Issue

    Dear All,
    I have some lists and libraries which has some calculated columns for calculating year and month based on created date and we have custom views which has group by on those calculated columns. The problem is group by is not working as expected. Attached are
    the screens for reference. We have also applied the June CU still no luck.
    Please help us on the resolution to the same.
    Rajani.J

    Hi Rajani,
    can you please paste your calculated formula here? Try this formula =TEXT(Created,"yyyy")&TEXT(Created,"mm") to check it is working correctly with numeric month or not?
    Thanks.

  • Group Totals Not Calculating Correctly P6 7.0 SP 4.0

    Hi there,
    For no reason I can tell, my schedule has suddenly started showing Group Totals in my layout that do not add up correctly, although the activity durations are correct.
    From past experience this is usually a calendar issue. I am using a Project Calendar, and the Hours per Time Period checkbox to use assigned calendar is ticked. I am using a 11hr / Day, 7 day a week calendar. Upon looking into the Global calendars, a 38hr week calendar is clicked as a default. Could this be causing the issue? I have done some calculations and it appears that some of the totals are being calculated on a 38hr week, but not in every case.
    I know the Global calendar issue was a problem in V6.0 but I was under the impression that the Project Calendar would overide in v7.0. is this the case?
    Is there something else I may be missing? The only major work that has been done recently is a colleague removed all the WBS Summary activities from the schedule.
    Can anyone provide any way forward?
    With Regards,

    Hi there,
    For no reason I can tell, my schedule has suddenly started showing Group Totals in my layout that do not add up correctly, although the activity durations are correct.
    From past experience this is usually a calendar issue. I am using a Project Calendar, and the Hours per Time Period checkbox to use assigned calendar is ticked. I am using a 11hr / Day, 7 day a week calendar. Upon looking into the Global calendars, a 38hr week calendar is clicked as a default. Could this be causing the issue? I have done some calculations and it appears that some of the totals are being calculated on a 38hr week, but not in every case.
    I know the Global calendar issue was a problem in V6.0 but I was under the impression that the Project Calendar would overide in v7.0. is this the case?
    Is there something else I may be missing? The only major work that has been done recently is a colleague removed all the WBS Summary activities from the schedule.
    Can anyone provide any way forward?
    With Regards,

  • Grouping By a Calculated Column Issue

    Hi,
    I have 2 issues when I try to group by a view using a calculated column:
    It will show the number of items under each group but you expand is not showing any items at all
    It will show the item reproduced 333 times.
    The first one it happens to all the lists and libraries on SharePoint 2013. However the second issue happened only in a document library that holds the employee Documents. The view is grouped by Document type column and the Employee column ( which is the
    calculated column). It shows multiple versions of the same document as stated above.
    Any help is very much appreciated.
    Thanks

    Hi,
    According to your description, there is an issue when grouping by Calculated column.
    It was a known issue in the early build version of SharePoint 2013, it is already fixed in the August 2013 CU:
    http://blogs.technet.com/b/steve_chen/archive/2013/03/26/3561010.aspx
    I suggest you install August 2013 CU or the later versions and then create new list for a test.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Consolidation group Hierarchy - rollup calculation issue?

    Hi,
    I am facing an issue with my consolidation groups hierarchy (created in SEM BCS).
    We have a new conso group hierarchy starting for our plans 2010 : we have new nodes (zones), new leaves (new Business units) and some BUs moved fom one node to another one.
    Level 1 ZONE
            Level 2  BUSINESS UNIT
    (simplified hierarchy since we have sub-zones)
    in a Bex report, I fixed this new consolidation group hierarchy in selection (in filters) (to be able to select the new zones, the new Business units etc.)
    I can only get figures for one version and one fiscal year/period with this report.
    Results :
    -When i call a new Business unit, i get the correct figures, but when i call its higher level (the zone), the figures of this new Business unit are not included.
    -If i call a new zone, i don't see the proper figures with the sum of its BUs  + elimination between the BUs of the zone : i just see the eliminations between its BUs.
    I checked the master data synchronization between BCS and BW and everything looks fine.
    Has anyone had the same issue? Is there any solution?
    Many thanks in advance
    Armelle

    error on the version.
    Version not specificed in the ABAP code used for the exit

  • Absence Deduction is calculated wrong for one employee

    Hi,  We have an employee who changed his absence booking for the year and all of sudden his absence deduction is not calculating properly.  His total absence quota was 20 days.  He initially booked all 20 days and then cancelled them and created a new booking for 9.5 days but his deduction is saying 16.5 days.
    Is there a way I can check his records why it's only happening to him.  Also I am new to this so not sure where to start investigating.  I did check the deduction rule and it's ok - calculates correctly for other employees, only this particular employee is calculating wrong.

    Hi Joe,
    I did replicate it for another employee belonging to the same group and it calculated correctly.  And the 9.5 days already excludes holidays and weekends.  Not sure what else to check at this point.  Although the only difference in the records of the 2employees is that the problematic employee has a negative carryover from previous year.  not sure exactly what that means.

  • How to add a calculated field in a list definition (schema.xml)?

    Hello,
    I'm currently trying to add a calculated field to a list definition (schema.xml).
    I have put the following code at the end of the schema.xml for the list I want to create. But when I deploy and activate the feature for the list, it doesn't appear in the list field.
    <Field ID="{EE20EC4B-4216-4259-A84F-C478CE42B70F}" Name="EC_EventsMgmt_CalculatedTime" StaticName="EC_EventsMgmt_CalculatedTime" Group="EC_EventsMgmt" Type="Calculated" DisplayName="Calculated Time" Required="TRUE" Hidden="FALSE" ReadOnly="FALSE" Format="DateTime"> <Formula>=DATE(2009,1,1)+TIME(EC_EventsMgmt_ScheduleHour,EC_EventsMgmt_ScheduleMinute,0)</Formula> <FieldRefs> <FieldRef Name="EC_EventsMgmt_ScheduleHour"/> <FieldRef Name="EC_EventsMgmt_ScheduleMinute"/> </FieldRefs> </Field>
    Could you please give me some help and explain me why it is not working?
    Thanks a lot.

    Hi there.
    If I understand correctly, you create this list within the same feature?
    If so, the list isn't available during the propagation, and therefore the calculated field can't be added.
    If this is the case, then you could work around this by adding a feature activated event handler to your feature and add the calculated field programmatically in that event.
    Hope this helps.
    Regards,
    Magnus
    My blog: InsomniacGeek.com

  • Link-Group Asset Class, Depreciation Area & Depreciation Key

    Dear Experts,
    I am new to FI-AA Customization & have a basic query about Group Asset Concept.
    I am working on Ecc 6.0 & for Country India.
    I want to create Group Asset for calculation of Depreciation as per Income Tax Act.  Hence there is just one Depreciation Area (for Group Assets) , but the Depreciation keys are different.  E.d IN1, IN2 etc. (Country Version India)
    Now the questions are :
    1) Do we need to create different Asset Class for different Group Assets or to create just 1 Asset Class for all Group Assets.
    E.g. I want to calculate Depreciation As per income Tax Act on Gross Block of Building, Furniture & Fixture, Motor Car, Vehicles etc. So I need to create separate Group Asset Class for each one of above or just to create one Group Asset Class.
    2) If we need to create just one Asset Class for all Group Assets; how to maintain a Depreciation Key in OAYZ as there are more than 1 Depreciation Keys?
    3) is there any other method / functionality to calculate Depreciation as per income Tax Act or Group Asset is the only functionality?
    Thanks & Regards,
    Reshma

    Dear,
    Reshma.
    Looking at your Questions let us take explanation for Group Assets :-
    1 ) We need to create new different asset class for Group Class in OAOA. Then permit the depreciation area for only Group Asset in OAYM as it is in your current scenario India  is Depreciation Area 15 Just select your company code in OAYM and check the Grp Asset field for respective area 15. Then go to OAAX here we have to maintain the assets classes particularly for Group Assets. So check your Group Asset classes for Group Assets. Cerate different Group asset classes for your said requirement.
    In these depreciation areas, it is then possible to make an assignment to a group asset.  You make this assignment in the specifications for the depreciation area in the asset master record.  When you post an acquisition to this kind of asset, the system duplicates the line items from this depreciation area on the given group asset.
    2 ) According to me you have to create different depreciation keys for Group Asset classes. Assign the Depreciation keys to your newly created Group Asset Classes in OAYZ and make sure you are deactivating 01 area which is Book Depreciation area.
    3 ) As far as I know this is the only functionality available to handle Group Assets. How ever SAP does not have any standard Group Assets functionality. SAP does not supply asset classes to be used solely for group assets. It is we have to determine as per varying Business Process.
    I hope this will clear your doubt makes you to understand. Please revert back for further clarification. Welcome you.
    Regards,
    Pankaj A Bhalerao.
    Edited by: pankaj_ab on Feb 3, 2010 8:26 AM

  • Distinct count inside a measure group with other measures

    Hello,
    I have 1 distinct count inside a measure group with other measures, sum, count etc. I know this is not recommended due to poor processing performance and query response time.
    Processing performance I can live with if it means not having another measure group, which increases processing time anyway.
    I have used the recommended approach before and it generated many questions about what this second measure group is for (visible via excel), even though I made the distinct count appear in the main measure group via a calculated measure.
    (it would be nice if you could hide measure groups)
    However my question is: is query response time only effected when the distinct count is used in the query? Or is query response time effected regardless if the distinct count is used or not??
    Below is an extract from the 2005 distinct count optimizer white paper. It’s not completely clear but I assume if effects queries regardless if distinct count is used or not?
    "By adding other measures to the measure group holding a distinct count measure, all of the other measures will be at the same granularity as the distinct count measure, resulting in inefficient data structures and suboptimal
    queries."

    You might also be interested in reading this blog post, which deals with a similar scenario, to get a feeling for some of the things that might be going on behind the scenes:
    http://cwebbbi.wordpress.com/2012/11/27/storage-engine-caching-measures-and-measure-groups/
    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

  • Schema group on vendor master ..?

    hi all
    Can anybody explain me about the schema group in MM
    1. what is schema group
    2.Its significance
    3.Where to configure//
    Thanks
    sap-mm

    Hi,
    Group for calculation schema (vendor): - Determines which calculation schema (pricing procedure) is to be used in purchasing documents containing this vendor number.
    Use: - You can use the schema group to specify the calculation schema per purchasing organization or vendor. The relevant calculation schema is determined by reference to the schema group.
    The effect of this is that the conditions to be maintained in a purchasing document can differ depending on the relevant purchasing organization or vendor.
    If a calculation schema is only to be valid for certain purchasing organizations or vendors, proceed as follows:
    1. Define the schema group for the purchasing organization or the vendor using the relevant function in the menu "Calculation schema -> Schema groups".
    2. Assign the schema group to the calculation schema via "Calculation schema -> Determine schema".
    3. Enter the schema group for the vendor in the vendor master records to which the calculation schema is to be assigned. Assign the schema group of the purchasing organization to the relevant purchasing organization using "Calculation schema -> Schema group -> Assign to purch. org.".
    You can  configure it in path SPRO > MM > Purchasing > Conditions > Define Price Determination Process > Define Schema Group, here do following;
    Schema Groups: Vendor
    Schema Groups for Purchasing Organizations
    Assignment of Schema Group to Purchasing Organization

  • How to apply a 'calculated' radius in Unsharp Mask en mass?

    In about a week's time, when I've finished applying Curves to about 1200 B&W images, I'll be ready to apply an Unsharp Mask to each of them. Exactly how I'll do that I'm not certain yet, but I've been reading my Photoshop CS Bible (Deke McClelland) in preparation. On page 503 it states:
    If you're looking for a simple formula, I recommend 0.1 of Radius for every 15 ppi of final image resolution... If you have a calculator, just divide the intended resolution by 150 to get the ideal Radius value.
    For example, at 300 ppi use Radius = 2. Such a recommendation is just that: a recommendation (and not 'ideal' as he also states), but I've taken it as a good starting point; and while I've been adding Curves I have also been experimenting with Unsharp Mask and various Radii (but not yet saving the sharpened images).
    McClelland's statement is not clear regarding what Radius should be used if you are NOT working on the image at final resolution. I think I know what the answer is, but I want to confirm.
    Some background: I'll be printing on a Xerox iGen running a colour line screen at 175 lpi. The printer wants the images to be 300 ppi. The images at the moment range from an effective ppi of about 100 to 2000, depending on how much they have been scaled in InDesign. So I've got resolutions all over the place which at some point I will have to tidy up. Those images below about 250 ppi, I will be upsampling to 300. Those above about 450 ppi (this may change), will be downsampled to 300 when I convert to PDF.
    I have some questions:
    QUES 1
    Say I have an image at 1200 ppi, that will be downsampled to 300 ppi. Should I do the sharpening on the 1200 ppi image, or on the downsampled 300 ppi image? i.e Will it make any difference to the final printed result if sharpening is done before or after downsampling?
    QUES 2
    I think the statement:
    I recommend 0.1 of Radius for every 15 ppi of final image resolution
    should read
    I recommend 0.1 of Radius for every 15 ppi of image resolution
    Surely the Radius (assuming you accept the figures McClelland gives) depends only on the resolution of the image you are working on. i.e if you have a 1500 ppi image, use a Radius of 10 (1500/150), NOT a Radius of 2 (300/150) -- the final image resolution that is sent to the printer. Is that a correct reading of McClelland's recommendation?
    QUES 3
    My experiments indicate that for the type of images I am using, McClelland's recommendation oversharpens, at least for my liking. I will probably use half the figure he suggests: Radius = 1 for 300 ppi.
    Given that I have about 1200 images, if I was going to apply an Unsharp Mask manually this is what I would do:
    1. Put all the layers in each image into a Group.
    2. Calculate the Radius to be applied to each image from the formula: Radius = (IMAGE PPI) /300.
    3. Apply an Unsharp Mask to the Group using the calculated Radius (plus Amount = 50, Threshhold = 0)
    Of course I'm not going to do this manually -- well, I hope I'm not -- but what is the best way? Could an Action handle all of this? A Script? A combination of both? Something else entirely? Not possible in PS?
    In summary: I want to automatically apply a variable Radius that depends on the image's resolution. Possible?

    The PDF says, for one of the steps:
    Command-click the duplicate channel to make the edge mask a selection.
    When I do that, a selection outline appears, but I can't work out, or find out, what conditions are applied to make the selection. Any ideas? I may have to start a separate thread for this question. I don't like to blindly follow recipes. I like to know what's going on.
    Guy,
    I'm not sure I understand your question. With command click, the channel is the selection. White = fully selected, black = not selected. It's all the steps made to create the channel that affect the selection. To me the selection edges are visually interfering with a soft mask, I usually hide the edges.
    In post 9 steps 2-6 all contribute to the final section. Find edges identifies the edges. Median has a smoothing effect. Maximum expands the selection a little, then the gaussian blur softens it.
    This process (post 9) works for me when I sharpen images, but you may not like it. Sometimes no mask at all is a viable option - some folks like a grainy/noisy appearance in non-edge areas. Some people may even purposefully add noise to create that kind of look.
    With USM the radius thickens the light and dark areas of edges, and amount intensifies (lightening the light, darkening the dark). Threshold is just what it's  name implies, it sets a parameter for Ps to apply the sharpening or not (but it can result in a pockmarked look in smooth areas, so I like 0)
    I always look at images at actual pixels in Ps when sharpening. With sharpening there is room for opinion. Some people like thicker edges (higher radius). Some people go easy on the amount, some people are more aggressive.
    It's the scaling in ID that makes things difficult, because actual pixels won't give you a true print appearance. To correct this the image either needs to be scaled to size in PS, and placed at 100% in ID - OR left as is in ID, and the resolution changed in PS (300 x % i.e. 300 x 25% = 75 PPI)
    I like to start with radius 1 and 100 amount but these values are always subject to change. I wish it was an exact science but it's not. I like sharp images, but I don't want icicles in eyebrows either. I believe you said 175 LPI screening, so if it was me I would err on the sharp side...
    Something else I just thought of - the print size is something to think about, too. Consider the two extremes (which may or may not apply to your project) - thumbnails, and posters. If it's a thumbnail, by the time you've got the scaling right in Ps, there really isn't much pixel information left! In his instance a lot of sharpening probably wouldn't hurt, it would create contrast (which is important in very small images). The other end of the spectrum - posters. Actual pixels may be a little misleading in this case, because when the average person looks at a poster, they don't get right up on it at a normal reading distance, they view it from several feet away. For this reason sometimes poster images are only half-resolution, to keep the file size manageable, and give a more realistic view perspective.
    Hope this helps. I am not a forum expert. The others may have better advice, or may see errors in my information.

  • Group security

    Hey guys,
    In an essbase application, I need users to read and load data to a specific country, while the rest location dimension is closed off to them. I need users to be able to read all the different scenarios but only load to Forecast (for that country). I need users to load to forecast as the months roll. For example, when February is done, they wont be able to load. I need users to load to only the current year.
    The previous admin had this all as one filter, but it doesn't work. The she assigned that filtered group to had calculation role and changing that to filter still didn't make a difference. I can read only the specific country assigned but i'm able to write for any scenario/month/year. Should i make this separate filters, add 1 filter to 1 group and then assign the user to each group (filter access to application)? I tried this method but the write still fails to be limited. Where am i going wrong?
    Suggestions please; greatly appreciated...

    The UDA was the original method for this cube. UDAS were used to change the scenario, the months and the year. It doesn't work. The filter works in terms of blocking out the access to all the other countries and enabling users to only read their location, but from the moment the UDAs come in play, it falls apart. Even though i use member names instead of UDAs, the write line for this cube just doesn't work as it should.

  • TPM44 bundling accrual/deferral flows usign grouping term

    Dear transaction manager experts,
    We are in ECC 6.0 and have migrated to Enhancement pack 4 enterprice 2.0. All the steps for the TPM_migration have been completed and configuration was converted for all accrual/deferral postings. We are now to use transaction TPM44 for posting the accrual/deferral in OTC transactions.
    We have instruments that have interest rate adjustment daily and are calculated monthly and our accrual method is reset procedure and the flows for the accruals are posting one by one per each day the rate is adjusted which was not the case for TBB4. I found note 1408198 which indicates we need to update the configuration with the grouping term...but I'm not sure what to use as the grouping term...is it a field name? ID?
    I would appreciate any help in this matter.
    Alba Amadoz

    Thanks Tomislav,
    But how does the system know it has to group the daily calculation?  See the transaction generates accruals per each adjustment...the update type is the same MM1200 +...for the same transaction.
    Where in the transaction do I update the same text so it knows it shoudl group the posting as total and not as line by line?
    Thanks,
    Alba

  • Incorrect result of calculations

    Hi everybody,
    I raised similar topic already on the forum and still can't find a proper solution. The problem is the calculations' result for certain groups of accounts is not always correct. E.g. before calculation started there was a group called "50" with total amount of 100EUR. The group consists of two 0 level accounts: 501 (75EUR) and 502 (25EUR). When upload of new data was finished, amount of acc. 501 changed up to 100EUR. So, theoretically, after calculations, amount of gropu "50" should change to 125EUR but it does not happen.
    Like I wrote this problem is always about random groups of accouts. By default all of them have the following features:
    two pass calculations: false
    consolidation: addition
    data storage: store data
    I'd like to mention that I found myself two temporary solutions of the problem. First is to change particular group into dynamic calculations. Second is to clear all upper level blocks and start calculations over.
    Although two mention above methods works I'd like to find something less radical than removing data each time error appears.
    can somebody help me with this?
    Radek

    It sounds like switching off intelligent calc will work.
    If it doesn't then it is likely to be an implied share (dbag guide for more info). To sort this then you will need to see where the implied share is occuring (which dimension) and then use the "never share" member storage option to resolve.
    Hope this helps
    Andy king
    www.analitica.co.uk

Maybe you are looking for

  • Sorry, a serious error has occurred... Rant and a solution

    Warning. Much of this post is frankly a rant against a poorly written program and the so-called experts who offer up solutions here. If you are one of these experts and you have a thin-skin, don't read this post. If you just want a solution to the pr

  • PO not getting created in the backend

    Hi I have made settings for R/3 PO to be created once a SC is approved, but I get the following errors in the "Application monitors>Shopping cart> backend application errors" 000Creation of PO using Enjoy BAPIunsuccessful MEPO 085Check item number 0

  • HP7520 printing with photoblack cartridge instead of the regular large black cartridge.

    Is there a way to select  which black cartridge the HP7520 should use? I am printing text documents but the printer repeatedly uses the photoblack cartridge. I have replaced the setup cartridges and have authentic HP cartridges but have still found t

  • How to move my music file to iTunes library

    On June 20, 2008, I burned 149 songs by the same singer into a DVD and also a CD-R. Later, I somehow lost most of these songs from my iTunes music library. Today, however, I seem to have found them, or almost all of them. I found them in Music>iTunes

  • Project Management features?

    Has Encore 2.0 any kind of project manager features built in? For example can a project be archived and retrieved with no fear of a major screw-up?? I'm asking as I'm sure both 1.0 and 1.5 crapped out and insisted on absolute paths when re-locating a