# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

## Current Fiscal Year Revenue & Last Fiscal Year Revenue

Hi Experts,

While calculating the Revenue for Current and Last fiscal year:

Variable is being used are as follows:

1. CurrentYear  Expression: Max(Right(FiscalYear,4)) -1 & '-' & Max(Right(FiscalYear,4)) Resultant > 2015-2016
2. LastYear Expression: Max(Right(FiscalYear,4)) -2 & '-' & (Max(Right(FiscalYear,4))-1)  Resultant > 2014-2015

Variables result has been tested by pasting them in charts > KPI.

Master Items Created with Expressions as follows:

1. RevCurrentYear Expression:
1. Sum({<FiscalYear = {'\$(CurrentYear)'}>}RowTotal) Does not work
2. Sum({<FiscalYear = {'2015-2016'}>}RowTotal) works fine
2. RevLastYear Expression:
1. Sum({<FiscalYear = {'\$(LastYear)'}>}RowTotal) Does not work
2. Sum({<FiscalYear={'2014-2015'} >} RowTotal) works fine

1 Solution

Accepted Solutions
MVP

## Re: Current Fiscal Year Revenue & Last Fiscal Year Revenue

Can you try one of these:

Sum({<FiscalYear = {'\$(=\$(CurrentYear))'}>}RowTotal)

Sum({<FiscalYear = {'\$(=(LastYear))'}>}RowTotal)

or

Sum({<FiscalYear = {'\$(=CurrentYear)'}>}RowTotal)

Sum({<FiscalYear = {'\$(=LastYear)'}>}RowTotal)

5 Replies
Honored Contributor

## Re: Current Fiscal Year Revenue & Last Fiscal Year Revenue

Hi,

This is just off the top of my head but try:

Sum({<FiscalYear = {"=\$(CurrentYear)"}>}RowTotal)

Honored Contributor

## Re: Current Fiscal Year Revenue & Last Fiscal Year Revenue

Ok so the simplest way is to use:

=Sum({<FiscalYear = {'\$(CurrentYear)'}>}RowTotal)

But whack an = on the start of your variable definition

=Max(Right(FiscalYear,4)) -1 & '-' & Max(Right(FiscalYear,4))

MVP

## Re: Current Fiscal Year Revenue & Last Fiscal Year Revenue

Can you try one of these:

Sum({<FiscalYear = {'\$(=\$(CurrentYear))'}>}RowTotal)

Sum({<FiscalYear = {'\$(=(LastYear))'}>}RowTotal)

or

Sum({<FiscalYear = {'\$(=CurrentYear)'}>}RowTotal)

Sum({<FiscalYear = {'\$(=LastYear)'}>}RowTotal)

Not applicable

## Re: Current Fiscal Year Revenue & Last Fiscal Year Revenue

Thanks, it worked.

Not applicable

## Re: Current Fiscal Year Revenue & Last Fiscal Year Revenue

Hi Sunny,

While using the all the three measures in same "LineChart", in Legends System shows

• CY (Current Year)
• LY (Last Year)
• SLY (Second Last Year)

How can I display year number i.e. variable value 2015-2016 .... 2014-2015 ... 2014-2013 in Chart Legends ?