Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

playingalex
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.

Thank you in advance.

1 Solution

Accepted Solutions
hirishv7
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
sathishkumar_go
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

hirishv7
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
MVP

Re: Year to Year Analysis

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

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

everest226
Contributor III

Re: Year to Year Analysis

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

playingalex
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)

playingalex
New Contributor

Re: Year to Year Analysis

Hirish, many thanks for your example - it works

Community Browser