Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

How to get the previous month data at the expression level

Hi ,

I am  facing the  issue in getting the data for the previous month and i have written the expression as to get the previous month closing inventory qty as current month opening inventory qty but the thing is i am not getting this instead i am getting 0 value

The expression which i have used is as shown below:

For Current Month :

sum({<CalendarMonthID={$(VCurrentCalendarFiscalMonth)}>}inventoryqty)

For Previous Month:

sum({<CalendarMonthID={$(Vcurrentcalendarfiscalmonth-1)}>}inventoryqty)

But still i am not able to get the exact value

Please help me on this as this is urgent.

Regards,

Smita

3 Replies
Not applicable

Re: How to get the previous month data at the expression level

Hi,

Use this in getting the previous month.

Date(AddMonths(Date#(Today(),'YYYY-MM-DD'),-1), 'YYYY-MM-DD')

Regards,

Janzen

chauhans85
Esteemed Contributor

Re: How to get the previous month data at the expression level

please find Month-Year(Jan-2012) in your application.

if not then calculate from Month

then in expression use below codes

Current Month

sum({<MonthYearField={$(=Date(Max(MonthYearfield),'MMM-YYY'))}>} amountfield)

previous MONTH

sum({<MonthYearField={$(=Date(addmonths(Max(MonthYearfield),-1),'MMM-YYY'))}>} amountfield)

hope this helps

Not applicable

Re: How to get the previous month data at the expression level

thanks for the help ,i will try this and will let you know

Community Browser