Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ravireddyk
Contributor III
Contributor III

i want compare of current year sales and previous year sales

i want compare of current year sales and previous year sales,so i tried using this expression

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

i did't get the result of that ,so please help to get a result

10 Replies
settu_periasamy
Master III
Master III

Try this

=sum({<Year={"$(=Max(Year)-1)"}>}LineSalesAmount)

parthakk
Creator II
Creator II

Hi Ravinder,

For current year: =sum({<Year={$(=Max(Year))}>}LineSalesAmount)

For previous year: =sum({<Year={$(=Max(Year)-1)}>}LineSalesAmount)

Thanks,

Partha Kulkarni

sunny_talwar

Are you comparing it in a text box object or a chart? Where exactly are you trying to make this comparison?

gautik92
Specialist III
Specialist III

Current Year YTD= Sum({$<Year={$(=Max(Year))}>}LineSalesAmount)

Last Year YTD= Sum({$<Year={$(=Max(Year)-vYear)}>}LineSalesAmount)

create a variable year vYear=1

create a input box with variable vYear

sasiparupudi1
Master III
Master III

is Year a date filed or a string field?

if you put max(Year) in a text box do you get the correct result?

if yes then your expression should work for the selected year

and for the previous year

sum({<Year={"$(=Max(Year)-1)"}>}LineSalesAmount)

hth

Sasi

qlikviewwizard
Master II
Master II

Hi,

Please check this thread. Hope this will help you.

Set Analysis for certain Point in Time

ravireddyk
Contributor III
Contributor III
Author

for charts

ravireddyk
Contributor III
Contributor III
Author

Anonymous
Not applicable

create a variable Max(Year) in the variable overview.

And in the expression set analysis use below expression:

sum({$<Year = {$(=vCy)}>}Sales)