Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to get last year saleQty and the this year saleQty by selecting a year and a month. Financial year begins from April. i m getting last year saleQty for a month like this.
Num((SUM({<year = {'$(=Max(year)-1)'}>}saleQty)),'#,##0')
but now i want to get saleQty for a period(April to this month) for last year and this year. pls help
is anyone have a solution?
Hi Dushan,
If you have date field in your data model then try like this
For Previous Year:
SUM({<Month=, Quarter=, Year=, Date={'>=$(=YearStart(Today(), -1, 4))<=$(=YearEnd(Today(), -1, 4))'}>}saleQty)
For Current Year:
SUM({<Month=, Quarter=, Year=, Date={'>=$(=YearStart(Today(), 0, 4))<=$(=YearEnd(Today(), 0, 4))'}>}saleQty)
Regards,
Jagan.
Hi Jagan, I only have year and month field in my model
Hi,
Arrive the Date field like this
LOAD
*,
MakeDate(Year, Month) AS DateFieldName
Regards,
Jagan.
Regards,
Jagan.
hi jagan, expression is not working
Try this
For YTD
Sum({< Datefield = {'>=$(=Date(vStartDate))<=$(=Date(vEndDate))'},FiscalYear=,Month= >} saleQty )
here my two variable
vStartDate =MonthStart(Date(min(Datefield)))
vEndDate =Date(Max(Datefield))
for LYTD
Sum({<Datefield={'>=$(vPYStartDate)<=$(vPYEndDate)'},FiscalYear=, Month=>}saleQty )
here my two variable
vPYStartDate =AddMonths('$(vStartDate)',-12)
vPYEndDate =AddMonths('$(vEndDate)',-12)
hope it helps
hi all, I need YTM
Hi, I have year, month and Sum(saleQty) columns only. I want to get YTM and LYTM from April(bcoz it s the first month of financial year)
Hi Mohit, How can I change this to YTM and LYTM. because I only have year and month columns , no date column in my database. pls tell me how can i do this using year and month