Query item not sold per customer for this month compare with last month

Dear all,
i want to make query that show information about item sold per customer last month which is not sell again this month.
for example last month customer A buy item 1,2 and 3. This month, customer A only buy item 2. So, the query will show information item 1 and 3 which is not sell again to customer A.
Thanks a lot

Here's one that will show you items bought in the last 60 days but not the last 30 days.  It's not perfect but will get you on your way, some bits will also not be relevant, like the qrygroup64 part.
select     t0.cardcode,
          t0.cardname,
          t2.slpname,
          t1.itemcode,
          t1.itemname,
          t1.onhand,
          s0.[2mthqty],
          s0.[2mthdollar],
          s1.[1mthqty],
          s1.[1mthdollar],
          s2.lastsale
from
(select     t0.cardcode,
          t1.itemcode,
          sum(t1.quantity) as [2mthqty],
          sum(t1.linetotal) as [2mthdollar]
from
oinv t0
inner join
inv1 t1
on t0.docentry = t1.docentry
where t0.docdate >= getdate()-60
and t1.quantity > 0
group by     t0.cardcode,
               t1.itemcode) s0
full outer join
(select     t0.cardcode,
          t1.itemcode,
          sum(t1.quantity) as [1mthqty],
          sum(t1.linetotal) as [1mthdollar]
from
oinv t0
inner join
inv1 t1
on t0.docentry = t1.docentry
where t0.docdate >= getdate()-30
group by     t0.cardcode,
               t1.itemcode) s1
on s0.cardcode = s1.cardcode and s0.itemcode = s1.itemcode
inner join
(select     t0.cardcode,
          t1.itemcode,
          max(t0.docdate) as lastsale
from
oinv t0
inner join
inv1 t1
on t0.docentry = t1.docentry
where t0.docdate >= getdate()-60
group by     t0.cardcode,
               t1.itemcode) s2
on s0.cardcode = s2.cardcode and s0.itemcode = s2.itemcode
inner join
ocrd t0
on s0.cardcode = t0.cardcode
inner join
oitm t1
on s0.itemcode = t1.itemcode
inner join
oslp t2
on t0.slpcode = t2.slpcode
where           (s1.[1mthqty] = 0 or s1.[1mthqty] is null)
and t0.qrygroup64 = 'N'

Similar Messages

  • Why is the Turbo using 3x more data this month compared to last month, not doing anything different in usage?

    This is for the Droid Turbo, wasn't doing anything different from last month and in one day the phone used over 75% of my data.  They gave me the run around on the phone, I don't use it for social media or things like that either.

    I appreciate you taking time to troubleshoot with us, Tommy! When checking in Settings>Data Usage, what are some of the main apps using data? Can also log in via http://www.vzw.com/datautilization to get a better idea of where the usage is going by category.
    YaleK_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • Process chain for updating a cube with last month's data everyday.

    Hi everybody,
    I need a suggestion on designing the process chain. I have the cube Zxx_xx. I will explain my requirement with an example. Suppose I uploaded the cube with data up to 201103. Each night in May, I want to upload the cube with April's data. So each night the previous request should be deleted. When May finishes, this time, each night I need to upload the cube with May's data. I handled everything except deleting the data from PSA. I need the data loaded in the cube stay at PSA. In this case the request including data till 201103,  the request loaded for April, and finally in June, I need to see the request loaded for May. In the last step of the process chain I added the process for deleting PSA data choosing my infosource, but I have no option for deleting the requests where I have uploaded from same infopackage with same selections. Please help handling this situation.
    thanks in advance.
    Yasemin.

    hi,
    You can achieve this by loading the cube through two different DTP's.
    DTP1 to have in the routine to pick data for month-2 i.e. in june it picks up April data.
    DTP2 to restrict the month in routine to month-1 i.e. in june it picks up May data.
    Now the design of process chain will be as follows:
    process chain to have an step "Decision Between Multiple Alternatives "
    in this decision step you can write formula to check if sy-datum is 01, first of every month.
    if step: formula
    ( RIGHT( 2, Current Date ) = '01' )
    On first of every month load for month-2 as well as month-1 and delete overlapping request for month-1. Variant described below.  DTP1, DTP2 and then Delete overlapping request step
    Else part of Decision Between Multiple Alternatives will be executed for all other days
    load only month-1 and delete overlapping request from cube. DTP2 and then Delete overlapping request step.
    in the pc there is variant "Delete overlapping request"
    in that choose variant type DTP, give the technical name of DTP2 and save it.
    this way the whole data loading will be automated and you need not intervene to delete data manually,
    regards,
    Arvind.

  • Which Time variable should use compare this month with last month

    We want to calculate the increaed number of employees according to one action reason e.g. Entry to company compare with last month. In this case we have to use time variable in BEx query designer. Now can see 0calmonth has serval variable available.
    1) Should we use [0CMLMON] for last month and use offset for this month like [0CMLMON]-1 or [0CMLMON]+1 or use variable [0RSTTCM1], which variable should we use for this month and last month? Do we need to create variables by manually?
    2) Then using calculated KF to calculate the increaed number of employees, is this logic correct? If it is wrong, please info.
    Edited by: hi ni on Apr 22, 2008 7:58 AM

    Hi,
    For the comparison of last 2 months data, you can use two Restricted Key figures with reference to 0CALMONTH and it is better to use only customer exit variable for both RKF's.For the Last month use offset value as -1.
    Rgs,
    I.R.K

  • Visual Studio 2012 SharePoint Project Error : The partial project item type does not have a value for this property

    Hi,
    I am getting this error from visual studio 2012 whenever i try to create the following project types:
    - Workflow Custom activity
    - Web parts
    The error is as mentioned below
    "The partial project item type does not have a value for this property"
    Due to this the when I add above type of items in my project, they show a red cross icon against them.
    Please let me know If have you any solution?

    Hi
    I had same issue. Below is the solution
    Installing
    "Visual Studio 2012 Update 3" usually solves this problem. (You can download it through microsoft's official site at
    "http://www.microsoft.com/en-in/download/details.aspx?id=39305")
    Hansraj Rathva

  • Itunes player says it has not been correctly localized for this language, Please choose the English version. It has played fine up until today.

    All of a sudden I can't play my itunes, everytime I click on the icon it comes up with an error message " This version of Itunes has not been correctly localized for this language. Please run the English version. There has never been a problem before. How can I choose a language when I can't even open the program? Thanks for any and all assistance!

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • MacAir - error message "This version of itunes has not been correctly localized for this language. Please run the english version" Saw other answers for windows users, I have a MacAir. never used any other language but English

    Trying to open iTunes - get an error message saying "This version of itunes has not been correctly localized for this language. Please run the english version" Saw other answers for windows users, I have a MacAir. never used any other language but English so I have no clue what the problem is.  I just want to update my phone and back it up.

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • Error message saying "iTunes has not been correctly localized for this language"

    When trying to launch iTunes I'm getting an error message saying "iTunes has not been correctly localized for this language.  Please run the English version"?  Any suggestions are much appreciated and thank you in advance!

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • Getting error:Absence type 100 was not found in Customizing for

    Hi,
    I am using the Standard workfllow for leave application, and when i am  creating the request i am getting the bleow error:
    'Absence type 100 was not found in Customizing for 21.10.2010'
    What could be the reason, i have configured the statndard setting for leave type 100 in SPRO.
    Thanks,
    Krish.

    Hi Kishore,
    Please check the validity period for Absence type 100 configuration.
    Also pass this Error message to your HR Functional consultant. It is the configuration issue and your FM have to take care of this issue.
    Thanks.

  • TS1967 my itune library won't opn i get a message saying this versio of itunes has not been correctly localized for this lanuage please run the english version

    itunes won't open it gives a message saying "this version of itunes has not been correctly localized for this language. please run the english version" i have a large library

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • HT1222 Everytime i try to open my itunes icon it says "This version of itunes has not been correctly localized for this language.  Please run the English version".  Then there is no option and i dont know to do this.  Please help.

    Everytime i try to open my itunes icon it says "This version of itunes has not been correctly localized for this language.  Please run the English version".  Then there is no option and i dont know to do this.  Please help.

    "This version of itunes has not been correctly localized for this language.  Please run the English version".
    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • I keep getting the following msg on my iTunes:This version of iTunes has not been correctly localized for this language.

    I keep getting the following msg on my iTunes:This version of iTunes has not been correctly localized for this language. Please run the English version.  What do I do?  I have tried changing the language and re-starting and that does not do anything at al

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • My iTunes is not opening it says this version of iTunes has not been correctly localized for this language.Please run the english version, what can i do to solve it, this problem occurs in all user accounts.

    My iTunes is not working, it says This version of iTunes has not been correctly localized for this language.Please run the english version. But it is already the english version, and this problem occurs in all the user accounts. What can I do?

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • ITunes didn't completely download my songs and now it says itunes has not been correctly localized for this language. Please use english version. What is this?

    iTunes didn't completely download all my songs. I updated iTunes and now this message appears "iTunes has not been correctly localized for this language. Please use the english version." The only option I have at this point is to close it down because I can't access iTunes because this message won't allow me to get in.

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • This version of itunes has not been correctly localized for this language. please run the english version

    Hello, I having a problem with my itunes it says that This version of itunes has not been correctly localized for this language. please run the english version ( it was working ok yesterday i don't know what happened) please help me

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

Maybe you are looking for

  • Imported Library but all content has to be downloaded?

    Hi, I recently rebuilt a home computer.  I had kept my entire media library one a second drive that I transferred into the new system.  After repointing the iTunes library to the root iTunes content directory on this drive, my content does not appear

  • Material type change which has different Acct Category reference

    Hi, Is it possible to change the Material type which has different Account category reference? Example Old Material type is HAWA  with Account category reference 0005 New Material type is UNBW with Account Category reference 0007 Regards Vengat

  • PC and Mac compatible?

    I have a friend who uses a windows based PC, they are doing updates with dreamweaver on a website for me - I run a Mac. Can we both do edits on the same website using dreamweaver and the updates be compatible with each other? I think I have worded th

  • Ios 8 stuck at preparing Update

    Erm now my ios 8 is stucked at preparing update.and i hope it can download....i forgotten to do a backup and deleted my apps....reply me please

  • My computer freezes right after start up

    Hello, I have a macbook pro OS X 10.6.8 I was working on my presentation using keynote. I had to force quit and shut down the computer while I had my keynote open. After that, my computer freezez right after start up. I see my background  picture and