# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for
Did you mean:
Creator II

## Present year previous year analisys

Hi,

I have a floor databae dates and the sales. I would like to make comparisons year Vs previous year. I did some variables:

VMaxDate =(max(DATEFINANCIAL))   this returns 41333 because Datefinancial is a floor.

VPriorDate = vMaxYear -1 this returns 41332

I would like to do calculations with this variables, but with this results I couldn't do, did you know how to solve this problem?

Thank's

Eduard

1 Solution

Accepted Solutions
Specialist

Hi,

Please make the corrections, the expression is as below-

For  Current Year :

Sum({<year= {\$(=max(Year))}>}Sales)

For Previous Year :

Sum({<Year= {\$(= max(Year-1))}>}Sales)

11 Replies
Master II

use date function:

Date(VMaxDate) and for previous year : =addmonths(date(VMaxDate),-12)

Specialist

Hi,

For Previous Month:

For Current Month:

Sum({<Month= {"\$(=Monthname(max(date)))"}>}Sales)

Specialist

Hi,

Please make the corrections, the expression is as below-

For  Current Year :

Sum({<year= {\$(=max(Year))}>}Sales)

For Previous Year :

Sum({<Year= {\$(= max(Year-1))}>}Sales)

Not applicable

Hi

For  Current Year :

sum({<PERIOD_YEAR={"\$(=max(PERIOD_YEAR)"}>}[Net Amount])

For Previous Year :

sum({<PERIOD_YEAR={"\$(=max(PERIOD_YEAR)-1)"}>}[Net Amount])

it works

Creator II
Author

Hi Neha,

The problem is when I want to apply the same logic to calculate the previous month!!

and doesnt work

Sum({<CalendarMonthName= {\$(= max(CalendarMonthName-1))}>}IMPORTBRUT)

Not applicable

Hi

use the below exp for the monthname condition

Specialist

Hi ecabanas,

Means you want to calculate for current YearMonth and Previous YearMonth?

Like for Dec2012 and Dec2011..

Creator II
Author

yes, that's I want to do!!!!

Partner

HI,

Try this for the last Year Month

Sum ({<Date = P({<Year={\$(=max(Year)-1)}>}Date)>}Sales)

Regards,

Nirav Bhimani

Community Browser