Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
Not applicable

How to display previous year value in year wise line chart ?

Hello All ,

I am working on sales dashboard where it need to display previous year value in line chart where dimension is year.

Below is data which used to build the chart

Saleyear Saleqty

2007       100

2008       150

2009       180

2010       190

2011       175

2012       125

I have tried with set analysis but didn't work.

13 Replies
Not applicable

Re: How to display previous year value in year wise line chart ?

Hi,

If you take dimension as year and expression as salesqty then the line chart will show the data for all the years.. if you want to show only previous year value then use calculated dimension..

=max(year)-1

or based on selections you want show data for previous years means you have to create on variable and use that in calculated dimension..

=$(vyear)-1

MVP & Luminary
MVP & Luminary

Re: How to display previous year value in year wise line chart ?

Hi,

Please find attached file.

Hope it helps you.

Regards,

Jagan.

Not applicable

Re: How to display previous year value in year wise line chart ?

As ur Requirement U want to display the data like below ryt?

Saleyear Saleqty

2007       -

2008       100

2009       150

2010       180

2011       190

2012       175

~ Kabilan K

er_mohit
Honored Contributor II

Re: How to display previous year value in year wise line chart ?

use this expression

sum({$<saleyear={$(#=only(Saleyear)-1)}>}Saleqty)

hope it helps you

Not applicable

Re: How to display previous year value in year wise line chart ?

hi

try according to this,

Examples:

sum( {$<Year = {$(#vLastYear)}>} Sales )
returns the sales for the previous year in relation to current selection. Here, a variable vLastYear containing the relevant year is used in a dollar-sign expansion.

sum( {$<Year = {$(#=Only(Year)-1)}>} Sales )
returns the sales for the previous year in relation to current selection. Here, a dollar-sign expansion is used to calculate previous year.

hope it helps you.

Partner
Partner

Re: How to display previous year value in year wise line chart ?

Hi,

Try this.

For Current Year:

sum({<Year= {"$(=Max(Year))"}} >}Sales)

Last Year Sales:

Sum({<Year= {"$(=Max(Year)-1)"},Quarter=,Year=>}Sales)

2 Year Back

Sum({<Year= {"$(=Max(Year)-2)"},Quarter=,Year=>}Sales)

Regards,

Nirav Bhimani

Not applicable

Re: How to display previous year value in year wise line chart ?

I have tried this one still it is showing output as per below data
SaleyearSaleqtyLY Qty
2007100100
2008150150
2009180180
2010190190
2011175175
2012125125
Please see attached file and help me on this.
Not applicable

Re: How to display previous year value in year wise line chart ?

didn' work for me .

Please see below I have given to Nirav Bhimani

Not applicable

Re: How to display previous year value in year wise line chart ?

didn't work . Please see reply given by me to Nirav Bhimani