Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
i been asked by get previous month of details using this query , help me out...
(((sum({<SalesFy=,Quarter=,Month=,Week=,BILLDATE=,DateNum={">=$(=Num(MonthStart(Max(DateNum),-1)))<=$(=num(MonthEnd(max(DateNum))))"},BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILAMOUNT)
-
SUM({<SalesFy=,Quarter=,Month=,Week=,BILLDATE=,DateNum={">=$(=Num(MonthStart(Max(DateNum),-1)))<=$(=num(=MonthEnd(max(DateNum))))"},BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDISCOUNT))
-
(sum({<SalesFy=,Quarter=,Month=,Week=,BILLDATE=,DateNum={">=$(=Num(MonthStart(Max(DateNum),-1)))<=$(=num(=MonthEnd(max(DateNum))))"},BILLDETAILENTRYTYPE = {'R'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILAMOUNT))
-
(sum({<SalesFy=,Quarter=,Month=,Week=,BILLDATE=,DateNum={">=$(=Num(MonthStart(Max(DateNum),-1)))<=$(=num(=MonthEnd(max(DateNum))))"}, BILLDETAILENTRYTYPE = {'O'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'},URDPURCHASE = {'Y'}>}BILLDETAILAMOUNT))
+
SUM({<SalesFy=,Quarter=,Month=,Week=,BILLDATE=,DateNum={">=$(=Num(MonthStart(Max(DateNum),-1)))<=$(=num(=MonthEnd(max(DateNum))))"},BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILOTHERSTONECHARGE)
-
SUM({<SalesFy=,Quarter=,Month=,Week=,BILLDATE=,DateNum={">=$(=Num(MonthStart(Max(DateNum),-1)))<=$(=num(=MonthEnd(max(DateNum))))"},BILLDETAILENTRYTYPE = {'R'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILOTHERSTONECHARGE)
-
SUM({<SalesFy=,Quarter=,Month=,Week=,BILLDATE=,DateNum={">=$(=Num(MonthStart(Max(DateNum),-1)))<=$(=num(=MonthEnd(max(DateNum))))"},BILLDETAILENTRYTYPE = {'O'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'},URDPURCHASE = {'Y'}>}BILLDETAILOTHERSTONECHARGE))
)/(AmtFlag)
Thanks in advance
What is this query calculating right now? Current Month?
Yeah Sunny it evaluates current month but, this question been solved...
Thanx for your concern....
HI,
i think your current query is calculating both current and previous months related data
">=$(=Num(MonthStart(Max(DateNum),-1))) --> Previous Month start
<=$(=num(=MonthEnd(max(DateNum))))" --> current Month end
if you need to calculate only previous month related data then use this
">=$(=Num(MonthStart(Max(DateNum),-1))) <=$(=num(=MonthEnd(max(DateNum),-1)))"