Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
eswarchandan
Contributor III
Contributor III

variance

hi i need a small help

iam showing the dashboard as month and years  as current and previous year and now i need to add previous before year in this

2017 expression

=sum({<CalendarYear =  {$(=year(today())-1)}>}Day_TotalNetAmt)

/sum({<Wrk_year = {$(=year(today())-1)}>}Wrk_day)

2018 expression

=sum({<CalendarYear = {$(=year(today()))}>}Day_TotalNetAmt)

/sum({<Wrk_year = {$(=year(today()))}>}Wrk_day)

need for 2016 expression ?

as variance i am showing the current year and previous year now i need to show as if we select 2017 and 2018 (or) 2017 and 2016 (or) 2018 and 2016 (or ) else  need to show 2016,17,18 default variance to be displayed

variance expression:

=((sum({<CalendarYear = {$(=year(today()))}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=year(today()))}>}Wrk_day))

-(sum({<CalendarYear =  {$(=year(today())-1)}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=year(today())-1)}>}Wrk_day)))

thanks in advance

variance %.PNG

9 Replies
mdmukramali
Specialist III
Specialist III

Hi,

If you select 2017 then do you need Variance between 2017 and 2016?

or do you want to consider 2018 also?

and can you sample some sample data file?

Anil_Babu_Samineni

Can you explain your Calendar Year returns, That means how many years it shows when filter as in?

You should make it as dynamic to work variance like

=((sum({<CalendarYear = {$(=Max(CalendarYear))}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=Max(CalendarYear))}>}Wrk_day))

-(sum({<CalendarYear =  {$(=Max(CalendarYear)-1)}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=Max(CalendarYear)-1)}>}Wrk_day)))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
eswarchandan
Contributor III
Contributor III
Author

its show current date for the current year and previous date of previous year

Anil_Babu_Samineni

Can you make bit clear? 2015,2016,2017,2018 having the data. So, If you filter for 2016 and 2018 what you want to see the variance?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
eswarchandan
Contributor III
Contributor III
Author

if i select 2017 then variance between 2017 and 2018

if i select 2016 then variance between 2016 and 2017

sample data file i will upload soon

eswarchandan
Contributor III
Contributor III
Author

I need to see the value of the variance when 2016 - 2018 = 2016 values as variance

sasikanth
Master
Master

Hi,

Try below one



use 2 expressions for Variance and enable based on condition


Variance:

Exp1      (Enable Condition : Getselectedcount(CalYear)>1 )


=((sum({<CalendarYear = {$(=min(CalYear))}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=min(CalYear))}>}Wrk_day))

-(sum({<CalendarYear =  {$(=max(CalYear))}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=max(CalYear))}>}Wrk_day))


Exp2      (Enable Condition : Getselectedcount(CalYear)<=1 )


=((sum({<CalendarYear = {$(=max(CalYear))}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=max(CalYear))}>}Wrk_day))

-(sum({<CalendarYear =  {$(=max(CalYear)-1)}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=max(CalYear)-1)}>}Wrk_day))

eswarchandan
Contributor III
Contributor III
Author

thanks sasi k

I will try this and let know if it work out.

Anil_Babu_Samineni

May be this?

=((sum({<CalendarYear = {$(=Min(CalendarYear))}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=Min(CalendarYear))}>}Wrk_day))

-(sum({<CalendarYear =  {$(=Max(CalendarYear))}>}Day_TotalNetAmt)/sum({<Wrk_year = {$(=Max(CalendarYear))}>}Wrk_day)))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful