Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
VenkateshYarra
Contributor II
Contributor II

Getting Last year as reference line, when i select a year in field

Hello Everyone,

I need to show the reference line of last year archived on selected year bar.

I am using as following

Dimension = FY ( nothing but year filed )

Expression = Num((Count($(vFormulaBelowPrfMin)) / $(vFormulaTotalProjects)), '###.0%') 

Now if i select FY = 2020, then bar will show the 2020 achieved %, Now i need to show the reference line on bar chart what is achieved as last year in 2019. 

I am not getting the expression how to write for last year. 

Please need help your guys..

 

Thank you

Venkatesh

1 Solution

Accepted Solutions
VenkateshYarra
Contributor II
Contributor II
Author

Sorry Arthur,

Thank you for your response. 

I can't share the qvw file with sample data ( Due to my organization policy ). Any how it is huge data and coming from different qvd.

Any how i changed the view of the graph. Now i am not showing the last year data.

Thank you for your help.

Regards

Venkatesh

View solution in original post

6 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

What is the expression for these 2 variables?

$(vFormulaBelowPrfMin)

$(vFormulaTotalProjects)

Brett_Bleess
Former Employee
Former Employee

Venkatesh, are you still trying to figure things out on this post, or did you get something worked out?  If the latter, please consider posting what you did and then use the Accept as Solution button on it after you post it to mark the thread as complete.  If you still need further help, please reply to Arthur's last post with content of the two variables.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
VenkateshYarra
Contributor II
Contributor II
Author

vFormulaBelowPrfMin=

Aggr({<$(vCurrentTargetFoundation)=>} If((Sum(Aggr($(vCurrentTargetMinimum), %KEY_ISO_FyQ_SDconv_OLI)) > (Aggr($(vFormulaPRF), %KEY_ISO_FyQ_SDconv_OLI)) or IsNull(Aggr($(vCurrentTargetMinimum), %KEY_ISO_FyQ_SDconv_OLI)))
and (Aggr($(vFormulaPRF), %KEY_ISO_FyQ_SDconv_OLI)) > 0, [Opportunity Line Number], Null()), [Opportunity Line Number])

vFormulaTotalProjects=
Count(DISTINCT [Opportunity Line Number])

Below is the requirement. Please see the attached image. 

Line.PNG

 

Thank you

Regards

Venkatesh Yarra

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

I couldn't help if your variables are nested with another variables, unless you can provide a sample app.

Or maybe others can help.

Brett_Bleess
Former Employee
Former Employee

To Arthur's point, if you are using variables inside variables, that is a very dangerous thing to do, as there is no guarantee of the calculation order of things here, so if you have done that, you should likely try replacing the variables inside the other variables with their associated expressions etc. and see how things then work, about the best I can offer in addition to what Arthur stated just to try to clarify things a bit further.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
VenkateshYarra
Contributor II
Contributor II
Author

Sorry Arthur,

Thank you for your response. 

I can't share the qvw file with sample data ( Due to my organization policy ). Any how it is huge data and coming from different qvd.

Any how i changed the view of the graph. Now i am not showing the last year data.

Thank you for your help.

Regards

Venkatesh