Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
abc_18
Creator II
Creator II

How to calculate previous year data

HI ,

My expression is

if(DIVISION='PUMA',sum({<FYEAR=>})Value,sum({<Year=>})Value)

if I select Year=2015 then its coming correct, how to get previous year data ie; 2014

Please suggest.

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Maybe like this:

if(DIVISION='PUMA',sum({<FYEAR={$(=only(FYEAR)-1)}>})Value,sum({<Year={$(=only(Year)-1)}>}>})Value)


If not, please post a small qlikview document that demonstrates the problem.


talk is cheap, supply exceeds demand
sunny_talwar

Are you using this in a chart where you have Year or Date as dimension? If yes, then you might need to use Above()/Below() functions to get this to work.

abc_18
Creator II
Creator II
Author

Hi Sunny,

Yes I am using this in a chart (Straight Table), and Date is a dimension.

Date I have linked with master calendar .

sunny_talwar

You will need to use Above()/Below() function to get it to work. Do you have a sample that you can share?

abc_18
Creator II
Creator II
Author

Hi,

In Master calendar I have two year field one for fiscal year and other for calendar year.(Fyear(Oct-Sep),Year(Jan-Dec))

I need to calculate FY'15, FY 16 Actuals value.(Two Calculated field).so for Intel division we need to use calendar year(Year) and for others division need to use Mater calendar(Fyear).

Likethis:-

if(Division='Intel',sum(value)based on Calendar year,otherwise sum(value) based on fiscal year).

Please  help me out in this..sample file is attached.