Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

need help

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

27 Replies
Not applicable
Author

is anyone have a solution?

jagan
Partner - Champion III
Partner - Champion III

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.

Not applicable
Author

Hi Jagan, I only have year and month field in my model

jagan
Partner - Champion III
Partner - Champion III

Hi,

Arrive the Date field like this

LOAD

*,

MakeDate(Year, Month) AS DateFieldName

Regards,

Jagan.

Regards,

Jagan.

Not applicable
Author

hi jagan, expression is not working

er_mohit
Master II
Master II


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

Not applicable
Author

hi all, I need YTM

Not applicable
Author

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)

Not applicable
Author

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