Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I am trying to count Last 3 Months Identical Sales, and using below expression, but its not returning any thing.
Could you please advise me about this?
=Count(If(
floor(Sum({$<Year=, Month=, [Year Month]={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),0)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),0)),'YYYYMM'))"}>} Sale))>0
And
floor(Sum({$<Year=, Month=, [Year Month]={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),0)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),0)),'YYYYMM'))"}>} Sale))
=
floor(Sum({$<Year=, Month=, [Year Month]={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),-1)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),-1)),'YYYYMM'))"}>} Sale))
And
floor(Sum({$<Year=, Month=, [Year Month]={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),0)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),0)),'YYYYMM'))"}>} Sale))
=
floor(Sum({$<Year=, Month=, [Year Month]={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),-2)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),-2)),'YYYYMM'))"}>} Sale))
,1))
Kind regards,
Farrukh
The above expression or just one part of it or another expression?
I mean if it could be like as below (from selected month to last 12 month)
Jan-16 |
Feb-16 |
Mar-16 |
Apr-16 |
May-16 |
Jun-16 |
Jul-16 |
Aug-16 |
Sep-16 |
Oct-16 |
Nov-16 |
Dec-16 |
And the check would still be between the current month and last month and current month and 2 months ago? or you would check this for 1 to 12 months ago?
May be this (not 100% sure)
Sum({$<Year=, Month=, YearMonth={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),-11)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),0)),'YYYYMM'))"}>}
Aggr(
If(
floor(Sum({$<Year=, Month=, YearMonth={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),-11)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),0)),'YYYYMM'))"}>} Sale)) > 0 and
floor(Sum({$<Year=, Month=, YearMonth={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),-11)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),0)),'YYYYMM'))"}>} Sale)) =
Above(floor(Sum({$<Year=, Month=, YearMonth={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),-12)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),-1)),'YYYYMM'))"}>} Sale))) and
floor(Sum({$<Year=, Month=, YearMonth={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),-11)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),0)),'YYYYMM'))"}>} Sale)) =
Above(floor(Sum({$<Year=, Month=, YearMonth={">=$(=Date(MonthStart(AddMonths(Min(SaleDate),-13)),'YYYYMM'))<=$(=Date(MonthStart(AddMonths(Max(SaleDate),-2)),'YYYYMM'))"}>} Sale)), 2), 1)
, Region, CityCode, ProCode, District, MonthYear))
check is for current month and 2 months ago. that's perfect.
Farrukh
Thanks a mil Sunny, this is the exact result I was looking for, Thanks again for your great help.
Farrukh