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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fiscal Year Set Analysis Previous year

hi i have the following format

2012-2013 on fiscal year

i would like to create a set analysis expression based on fiscal year

i have tried the following without success ;

sum( { $<FiscalYear = Year={"$(=max(Year)-1 & '-' & max(Year)-2"))}>}OrderAmt

any help is greatly appreciated.

Best

Brad

Labels (1)
1 Solution

Accepted Solutions
Clever_Anjos
Support
Support

I think

sum( { $<FiscalYear = Year={"$(=max(Year)-2 & '-' & max(Year)-1"))}>}OrderAmt)


should be the correct




View solution in original post

7 Replies
abeyphilip
Creator II
Creator II

Hi,

Check if this help:

sum({<Year={"$(=$(vYear1)&'-'&$(vYear2))"} >}OrderAmt)

with two variables:

vYear1 = max(Year)-1

vYear2 = max(Year)-2

Regards,

Abey

pgrenier
Partner - Creator III
Partner - Creator III

Hello Bradley,

I believe this might come in handy:

Sum({<FiscalYear={"=(Max(Year)-1)&'-'&(Max(Year)-2)"}>} OrderAmt)

Cheers,

Philippe

Not applicable
Author

Thank you for your advice.

unfortunately i need a statement that is dynamic so that is  i can get the previous calender year as well.

for example if i if i choose 2013-2014 i would like to see 2012 -2013 in the column beside 2013-2014.

example

Sum({<FiscalYear={"=(Max(Year)-1)&'-'&(Max(Year)-2)"}>} OrderAmt)



Sum({<FiscalYear={"=(Max(Year)-2)&'-'&(Max(Year)-3)"}>} OrderAmt)

i have tried with increasing minus values to 1 in the statement but to no avail.

any tips

Best,

Bradley

pgrenier
Partner - Creator III
Partner - Creator III

I see,

I believe you shall have to parse the contents of the current selected FiscalYear, and work with that. Would you mind giving this statement a try?

Sum({<FiscalYear={"=(Left(FiscalYear, 4)-1)&'-'&Left(FiscalYear, 4)"}>} OrderAmt)


Cheers,


Philippe

chematos
Specialist II
Specialist II

With $(=max(Year)-1 & '-' & max(Year)-2), don't you get 2012-2011 instead of 2012-2013?


Also, I think you need simple quotes to get '2012-2013' and compare with FiscalYear

try this:

sum( { $<FiscalYear ={'$(=(max(Year)-1) & '-' & max(Year))'}>}OrderAmt)


Hope this helps


Regards

Clever_Anjos
Support
Support

I think

sum( { $<FiscalYear = Year={"$(=max(Year)-2 & '-' & max(Year)-1"))}>}OrderAmt)


should be the correct




anna_elle
Contributor
Contributor

Hey Philipe,

 

I tryed all your smart suggestions, without success.

The issue is that once I set the quotas, the funktions are recognised as a string:

qlik.PNG

I created the fiscal year by using the Funktion "yearName" , the format of the output is a date and is shown as 2012-2013. 

Do you know what the solution could be?

Many Thanks,

Anns