Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current year and previous year fiscal year calculation(July-June)

Hi everyone,

I am new in Qlikview.I need your expart solution.Please help me .I am getting problem with prevoius fiscal year calculation.

When I select year -2010 and Month - Feb

then current year data is 2010 july to 2011 feb(getting right data) and

prevoius year data is 2009 july to 2010 feb(getting data from 2009 july to 2010 june(its worng data)).

My current year expression is -

=num(sum({$<Year1 = {$(=max(Year1))}, MonthName = {"<=$(=max({<Year1={$(=max(Year1))}>} MonthName))"}>} if(PARTICODE=500 or PARTICODE=600 or PARTICODE=610 or PARTICODE=640 or PARTICODE=645 or PARTICODE=650 or PARTICODE=655, ActualAmount2)))

and its working fine.

But previous year calculation expression is -

=num(sum({$<Year1={$(=Year(Max(Year1))-1)}, MonthName = {"<=$(=max({<Year1={$(=max(Year1))}>} MonthName))"}>}  if(PARTICODE=500 or PARTICODE=600 or PARTICODE=610 or PARTICODE=640 or PARTICODE=645 or PARTICODE=650 or PARTICODE=655, ActualAmount2)))

Thanks

3 Replies
er_mohit
Master II
Master II

try this for previous year

sum(yearname(yearname(today()-1))ActualAmount2)

hope it helps

renjithpl
Specialist
Specialist

If your monthname is of format "Dec 2012", "Nov 2012" .... then

try Current selection year

 

Sum(<YEAR=, Month =, MONTH_NAME = {"$(=MonthName(max(MONTH_NAME)))"} >} ActualValue2)

Previous Year

Sum( {<YEAR=, Month =,MONTH_NAME = {"$(=MonthName(AddMonths(max(MONTH_NAME), -12)))"}>} ActualValue2)

Not applicable
Author

Hi renjithpl,

thanks for the prompt reply.I tried with your script but it didn't work.it shows only selected previous year month sum.

thanks