0

I have to check if sales happened for every unique customer in the next quarter.

Condition1: For a speciafic customer if a product sold in a quarter and a different product being sold for same customer in next quarter then I have to flag it cross sell.

Condition2: Above condition of cross sell only hold if sell happens of a different product for same customer in next quarter not previous previous quarter.

I am attaching screenshot where result column has the desired output.enter image description here

Moradnejad
  • 3,466
  • 2
  • 30
  • 52
anil
  • 101
  • 1
  • 1
  • 7
  • Are you using any libraries in addition to standard Python ones (eg: pandas) - how are you getting the data from Excel (or do you just happen to have it open in a spreadsheet system and it's CSV or similar) - if you could provide more information that'd give a better chance of you receiving an answer. – Jon Clements Apr 17 '22 at 15:02
  • Thanks Sir..Its pandas and I am reading csv – anil Apr 17 '22 at 15:03
  • Please feel free to [edit] your question with that information and also provide a dump of the first 10/20 rows of your dataframe as a codeblock? So someone can more easily experiment with it (it doesn't appear to contain confidential information) – Jon Clements Apr 17 '22 at 15:05
  • Ok Sir..I will do – anil Apr 17 '22 at 15:06
  • Please also read [this question](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) – Quang Hoang Apr 17 '22 at 15:09

0 Answers0