# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

New Contributor

## Year to Year Analysis

Hi, all

Could you please help me with calculation of gross rate for selected period to the same period of prior year (year to year analysis). Would you be so kind to show this using the attached example.

1 Solution

Accepted Solutions
Honored Contributor

## Re: Year to Year Analysis

Hi,

Check this,

Dimension:

Product

Expression :

Previous Year-      Sum ({<YEAR={"\$(=Max(YEAR)-1)"}>}SALES_AMOUNT)

Current Year-        Sum ({<YEAR={"\$(=Max(YEAR))"}>}SALES_AMOUNT)

HTH,

PFA

Hirish

6 Replies
Contributor III

## Re: Year to Year Analysis

Hi,

use setanalysis.

sum({<YEAR = {'\$(vCurYear)'} >} SALES_AMOUNT)

sum({<YEAR = {'\$(vPreYear)'} >} SALES_AMOUNT)

VCurYear and vPreYear is a variable to get the value of current year and previous year

-Sathish

Honored Contributor

## Re: Year to Year Analysis

Hi,

Check this,

Dimension:

Product

Expression :

Previous Year-      Sum ({<YEAR={"\$(=Max(YEAR)-1)"}>}SALES_AMOUNT)

Current Year-        Sum ({<YEAR={"\$(=Max(YEAR))"}>}SALES_AMOUNT)

HTH,

PFA

Hirish

MVP

## Re: Year to Year Analysis

max, as already suggested, or only (there is a small difference)

Sum ({<YEAR={"\$(=only(YEAR)-1)"}>}SALES_AMOUNT)

Contributor III

## Re: Year to Year Analysis

Sum ({<YEAR={"\$(=only(YEAR)-1)"}>}SALES_AMOUNT)

New Contributor

## Re: Year to Year Analysis

Sathish, thank you for this idea, however i do not have any result using this construction

sum({<YEAR = {'\$(vCurYear)'} >} SALES_AMOUNT)/sum({<YEAR = {'\$(vPreYear)'} >} SALES_AMOUNT)

New Contributor

## Re: Year to Year Analysis

Hirish, many thanks for your example - it works