How to calculate number of cutomers that have bought more than variable qnt

Hi BW Gurus!
My InfoProvider has following structure:
CalDay     BusinessPartner1 Customer SoldQnty
01.02.2005                    1               3       100
02.02.2005                    2               4       50
03.02.2005                    1               3       150
04.02.2005                    1               3       70
I need to calculate a number of Customers who has bought more than user typed quantity.
If user input 90 then according to my example number of customers should be 1.
If user input 40 then number of customers should be 2.
I have to use formula variable so that user could input quantity.
In this case I cannot use calculated key figure with type "assignment" to redefine exceptional aggregation.
Please help.
Any responce is highly appreciated.
Thanx!

Hi Bhanu!
Thank you for your response!
I will describe my problem more precisely.
InfoProvider has(approximately) following structure:
CalDay BPartner1 BPartner2 BPartner3 Customer SoldQty
02.02.2005   1       2        3       101        90
02.02.2005   1       2        4       101       120
03.02.2005   1       2        3       102        50
03.02.2005   1       2        4       101       150
04.02.2005   1       2        3       103       150
We have to build a query  to calculate a number of customers which have SoldQty greater than predefined by user on selection screen by variable with possibility to drill-down with all BusinessPartners.
CalDay is restricted by interval variable.
According to example above
report should have following result for variable
for SoldQty = 100
and CalDay interval = [01.02.2005 ; 05.02.2005]
via selection screen
BPartner2   BPartner3    CountOfCustomers
   2           3                1
   2           4                1
In case of variable for SoldQty = 80
and CalDay interval = [01.02.2005 ; 05.02.2005]
BPartner2   BPartner3     CountOfCustomers
   2           3                2
   2           4                1
Using formula you described I recieve just 1
in each row of the report. I can create calculated key figure instead of formula with the same logic(on Infoprovider level)with calculations before aggregation.
But in that case I calculate number of sales greater than predefined quantity
and I need number of customers...
Please help!

Similar Messages

  • How to calculate  number of sundays and saturdays between two Dates

    friends i want to calculate how many Sundays come in two Dates
    i have tried following code which is hard coded i have to impliment method which can give me number of Sundays between two Dates
    please help me
    import java.util.Date;
         import java.text.DateFormat;
         import java.text.SimpleDateFormat;
         import java.util.Calendar ;
         import java.util.GregorianCalendar;
    public class DateDiffCalculator     {
         private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MMM-dd");
    public DateDiffCalculator()     {
         public static Date getDate (String date) throws Exception {
    //log.debug(" "+date);
              return SDF.parse(date);
    public static Date getDate (Date date) throws Exception {
    // log.debug("date is "+date);
              return getDate(SDF.format(date));
    public static long getDiffInDays(Date d1,Date d2)     {
         boolean isdiffGreaterThanYear=false;
         long diffInMilliSeconds=d1.getTime()-d2.getTime();
         return diffInMilliSeconds/(1000*60*60*24);
    public static int getYear(String date)     {
              //String[] day=     {Sun,Mon,Tue,Wed,Thu,Fri,Sat};
              Integer     year=new     Integer(date.substring(0,4));
         return year.intValue();
    public static int getMonth(String date)     {
              //String date.substring(5,7);
              System.out.println(" "+date.substring(5,8));
              String     m= date.substring(5,8);
              int month=0;
              if(m.equalsIgnoreCase("Jan"))     {
              month=1;
              if(m.equalsIgnoreCase("Feb"))     {
              month=2;
              if(m.equalsIgnoreCase("Mar"))     {
              month=3;
              if(m.equalsIgnoreCase("Apr"))     {
              month=4;
              if(m.equalsIgnoreCase("May"))     {
              month=5;
              if(m.equalsIgnoreCase("Jun"))     {
              month=6;
              if(m.equalsIgnoreCase("Jul"))     {
              month=7;
              if(m.equalsIgnoreCase("Aug"))     {
              month=8;
              if(m.equalsIgnoreCase("Sep"))     {
              month=9;
              if(m.equalsIgnoreCase("Oct"))     {
              month=10;
              if(m.equalsIgnoreCase("Nov"))     {
              month=11;
              if(m.equalsIgnoreCase("Dec"))     {
              month=12;
              return month;
         public static int getDay(String date)     {
              Integer     day=new     Integer(date.substring(9,11));
         return day.intValue();
    public static int getNumberofSundays(String d1,String d2) throws Exception     {
              //d1 is leave start date d2 is leave end date
              // get object in Date form
                   Date date1=getDate(d1);
                   Date date2=getDate(d2);
              // now get calender objects from it
              GregorianCalendar c1= new GregorianCalendar(getYear(d1),getMonth(d1),getDay(d1));
              GregorianCalendar c2= new GregorianCalendar(getYear(d2),getMonth(d2),getDay(d2));
              // get period
              long leavePeriod = getDiffInDays(date1,date2);
         return 12; // it should return number of sundays but we type 12 to perform compilation
    public static void main(String[] arg)throws Exception     {
    System.out.println(" "+getNumberofSundays("2005-Oct-07","2006-Mar-01"));
    }

    thanks now i have modified the get Month Code
    as follows
    public static int getMonth(String date)     {
              //String date.substring(5,7);
              System.out.println(" "+date.substring(5,8));
              String     m= date.substring(5,8);
              int month=0;
              if(m.equalsIgnoreCase("Jan"))     {
              month=0;
              if(m.equalsIgnoreCase("Feb"))     {
              month=1;
              if(m.equalsIgnoreCase("Mar"))     {
              month=2;
              if(m.equalsIgnoreCase("Apr"))     {
              month=3;
              if(m.equalsIgnoreCase("May"))     {
              month=4;
              if(m.equalsIgnoreCase("Jun"))     {
              month=5;
              if(m.equalsIgnoreCase("Jul"))     {
              month=6;
              if(m.equalsIgnoreCase("Aug"))     {
              month=7;
              if(m.equalsIgnoreCase("Sep"))     {
              month=8;
              if(m.equalsIgnoreCase("Oct"))     {
              month=9;
              if(m.equalsIgnoreCase("Nov"))     {
              month=10;
              if(m.equalsIgnoreCase("Dec"))     {
              month=11;
              return month;
    but question remains same how to calculate number of Sundays Between 2 Dates

  • How to calculate number of threads  running  on Windows 2000 terminal?

    How to calculate number of threads running on Windows 2000 terminal for the oracle process?
    I have installed Oracle 9i DataBase with 6 patch(9.2.0.6.0) on Windows 2000 Terminal.
    But,after database is started up, when i check up the sessions in v$session view.
    It is showing like for SYSTEM osuser alone, 10 ORACLE.EXE sessions running on this server machine in active state.
    Why it is creating 10 ORACLE.EXE sessions for a single Oracle Server.
    This is the output of v$session view.
    SQL> select terminal,osuser,status,sid,serial#,program from v$session;
    TERMINAL OSUSER STATUS SID SERIAL# PROGRAM
    IMGDBSVR SYSTEM ACTIVE 1 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 2 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 3 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 4 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 5 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 6 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 7 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 8 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 9 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 10 1 ORACLE.EXE
    SUGANTHI_DBA suganthi ACTIVE 11 91 sqlplusw.exe
    11 rows selected.
    SQL>

    This is how i have related these two views:
    SQL> select s.terminal,s.osuser,s.status,s.paddr s_paddr,b.paddr p_paddr,s.program
    2 from v$session s,gv$bgprocess b
    3 where s.paddr=b.paddr;
    TERMINAL OSUSER STATUS S_PADDR P_PADDR PROGRAM
    IMGDBSVR SYSTEM ACTIVE 33AF2270 33AF2270 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF2654 33AF2654 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF2A38 33AF2A38 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF2E1C 33AF2E1C ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF3200 33AF3200 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF35E4 33AF35E4 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF39C8 33AF39C8 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF3DAC 33AF3DAC ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF4958 33AF4958 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF4D3C 33AF4D3C ORACLE.EXE
    10 rows selected.
    SQL>
    Here, It shows 10 sessions are running.
    Whether this means 10 threads are running on the particular server or not?

  • I updated my iPod and it erased everything i had on it.  How do i retrieve the songs that i bought from the iTunes store?  when i try to download/buy them again they tell me i have already purchased them do i want to buy them again?

    I updated my iPod and it erased everything i had on it.  How do i retrieve the songs that i bought from the iTunes store?  when i try to download/buy them again they tell me i have already purchased them do i want to buy them again?  I have authorized my computer but none of them are in my music now.

    You buy one and only one download.
    It is your responsibility to move/copy/backup your music.
    Certainly you did not update your ipod without making sure that you had transferred anything purchased on the ipod to your computer and included it in your regular backup copy of your computer.

  • How to calculate number of rows for perticular characterstic in SAP BI Bex

    Hi experts,
    Please let me know how to calculate  ' number of rows  ' for perticular characterstic in Bex query. 
    Thanks & Regards,
    Babu..

    Hello,
    You can try this
    Create a CKF and assign the vale 1 to it. Open the query and select Character where you want to display ' number of rows ', go to properties windows, select 'display', in the results row drop down box, select  'always display'.
    Thanks.
    With regards,
    Anand Kumar

  • Statistic number of forms that have been accessed/loaded

    Hello,
    I would like to ask if it is possible to know the statistic number of forms that have been accesses/loaded on the workspace base on each process category/folder to create a weekly or monthly report? 
    Thanks,
    Han Dao

    You can export any response as a PDF, which you can then archive.

  • How to check the sales orders that have been created with an Rebate Agreeme

    Dear Experts,
    Do you know how to check the sales orders that have been created with an Rebate Agreements?
    Thanks!!

    Hi Hoo Laa,
    I have one way but little lengthy.
    Rebate condition always appears in the billing document.
    So 1st you extract the sales order list from Table VBAK.
    once you have the sales order list then you can put your order list in Table VBFA --> Extract the billing document list.
    Now put that list in the table VBRK.
    In VBRK you will get the "Doc. condition" --> put that doc condition in table KONV with your rebate condition type.
    It will show the result.
    Later, through VLOOKUP you can identify in which order you have given rebate to your customer.
    Already said, Little lengthy
    Regards,
    MT

  • How do i retrieve deleted items that have been deleted by mistake

    how do i retrieve deleted items that have been deleted by mistake ?

    If they’re not in a backup, try using a data recovery product such as the ones listed here. Don't write anything else to the drive until the files are recovered or you choose not to recover them.
    (116899)

  • I am considering installing the latest version of OS X Mountain Lion but am concerned by the number of users that have had severe problems. Has Apple sorted this out?

    I am considering installing the latest version of OSX Mountain Lion but am concerned by the number of users that have had severe problems. Has Apple sorted this out?

    As I told you, you have to do some steps before upgrading to OS X Mountain Lion.
    First of all, make a backup of your files using Time Machine and/or Carbon Copy Cloner. If you make both, good, but if you only make one, it's OK, too.
    OS X Lion and OS X Mountain Lion aren't compatible with PowerPC applications, so you have to check if your applications are compatible > http://www.roaringapps.com If you have to update an application, do it before upgrading, because the Mountain Lion installer moves unsupported applications to a separate folder.
    After doing that, open Disk Utility, select "Macintosh HD" in the sidebar and repair permissions. Then, verify the disk to check if it's OK. If everything is right, just open the App Store and purchase OS X Mountain Lion

  • How to determine number of photos I have?

    I cannot find anywhere in Photoshop Elements where it tells the total of photographs I have in my collection.  The old version told this number in the lower right hand corner.  Is there somewhere in this newer version where I can find how many photos I have without having to count them?  Please help.  Thanks.

    Thanks so much Neale!!!
    In a message dated 2/19/2014 7:05:52 P.M. Eastern Standard Time, 
    [email protected] writes:
    Re:  How to determine number of photos I have?
    created by nealeh (http://forums.adobe.com/people/nealeh)  in Photoshop 
    Elements - View the full  discussion
    (http://forums.adobe.com/message/6137888#6137888)

  • How could I update my apps that have my old Apple ID and how could I use face time

    How could I update my apps that have my old Apple ID n how could I use face time

    I can't help you if you don't know your Apple ID and/or password. You can change your password at: Manage My Apple ID. You will need to know the answers to your security questions. If you don't know those, then see the following:
    Alternatives for Help Resetting Security Questions and Rescue Mail
         1. Apple ID- All about Apple ID security questions.
         2. Rescue email address and how to reset Apple ID security questions
         3. Apple ID- Contacting Apple for help with Apple ID account security.
         4. Fill out and submit this form. Select the topic, Account Security.
         5.  Call Apple Customer Service: Contacting Apple for support in your
              country and ask to speak to Account Security.
    How to Manage your Apple ID: Manage My Apple ID

  • HT2736 How do I cancel a movie that I bought, but have not watch.

    How do I cancel a movie that I bought, but have not watch.

    All purchases are considered final, but you can try contacting iTunes Support and see if they will refund or credit you : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • I am trying to download IOS7 to my iphone4s. It says I need at least 3gb to install it. I have much more than that. How do I install IOS7???

    I am trying to download IOS7 to my iphone 4s. I get a message that says I have to have at least 3 gb to do it. I have much more than that. Why is it not seeing how much gig I do have and how do I download IOS7??

    davidd50 wrote:
    does that mean that the extra storage I purchased can't be used?
    Again, iCloud storage has nothing to do with this. You need the free space directly on your phone if you want to update OTA. Otherwise, update using iTunes on your computer.

  • HT5622 how do i retrieve text messages that have been deleted

    How do I retrieve text messages that have been deleted? How much do I Have to pay to get them back? I meant to delete one message that was sent and I accidentally deleted all of precious pictures

    those text message should be in your backup, if you backup on a regular basis.  restore your phone to that backup.

  • How do i delete the songs that have been downloaded onto my iphone?

    how do i delete the songs that have been downloaded onto my iphone?

    doesn't work... it still shows i hv all the songs in my iphone...
    i've deleted all the songs... emptied the Recycle Bin too...
    i used to be able to just clear all the music away and sync in a whole new set of songs..
    but i can't do it now...
    sad...
    any help available as i do not want to have to do it manually one by one unchecking the songs...

Maybe you are looking for

  • FM for Purchase requisition status

    Hi,   Is there any FM for Purchase requisition status. Do let me know. Regards, SP

  • Download excel File WITHOUT IWDLinkToURL

    Good morning.        I need to open an excel file for the customer to open or save, as it is with a IWDLinkToURL, but I can not do it with a IWDLinkToURL by specifications of the application that I'm doing.        Consider the following code:        

  • How do I set my numbers to automatically add comma separators at thousand increments?

    I make a lot of charts with large numbers and it's time consuming to add all the commas every time. For example 1,234,567 instead of 1234567. I need the formula to work for all sizes of numbers.

  • DVD-RW can't burn

    Hello. I have a problem with my dvd-rw. I have HP Probook 4525s. When start burning a dvd, at 2% progress stop and receive error "Burning Process Failed". I can't burn files to disc. I have windows 8, any solutions? I use nero for burning, but i try

  • Printer won't work with elements 9

    using elements 9...up until today had no problem connecting to my Epson Stylus Photo 1400. Now printer makes noises and then stops. However printer functions when printing from web-sites..so must be the connection betwenn elements and printer. What t