Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how to write expressions for mtd,ytd,pytd,qtd?
regards,
koti
MTD
=SUM({<InvoDate = {">=$(=MonthStart(Max(InvoDate)))<=$(=MonthEnd(Max(InvoDate)))"}>}Sales)
YTD
=SUM({<InvoDate = {">=$(=YearStart(Max(InvoDate)))<=$(=Max(InvoDate))"}>}Sales)
PYTD
=SUM({<InvoDate = {">=$(=YearStart(Max(InvoDate),-1))<=$(=YearEnd(Max(InvoDate),-1))"}>}Sales)
QTD
=SUM({<InvoDate = {">=$(=QuarterStart(Max(InvoDate),-1))<=$(=QuarterEnd(Max(InvoDate),-1))"}>}Sales)
Change Max(InvoDate) to Today() if you want to get all these results with respect to Today
Hi,
try something like this:
Sum({<YearField = {$(#=Max(YearField))},MonthField = {"<=$(#=Num((Max(MonthField)))"} >} myField) // YTD
Sum({<YearField = {$(#=Max(YearField))},MonthField = {$(#=Num(Max(MonthField)))}, DayField = >} myField) // MTD
Best regards.