Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have text box expression which is working with current year.i'm trying to calculate previous year value in the text box but value is zero.
Used below formula for previous year.
{<[Year]={$(=Max([Year])-1)>}
Is there any method to calculate previous year other than above method.If yes , please provide your view to calculate previous year.
This is to be resolved today.Pls help
Regards,
Venkat
I tried below code.As field selection is null the vlaue in the expression is zero.
=If(GetFieldSelections(Year)>0,num(avg({<[Year]={'$(=Max(Year)-1)'}>} aggr(
if('$(vPerformance)'='Delivery',
if($(vAcceptableDaysDelayed) >= fabs( avg({<[Year]={$(=Max(Year)-1)'}>} aggr( $(eDOT_DiffDel) , $(eAggrLevel1) )) ) ,1,0)
, ),[Purchasedoc], [Purchaseposition]))*100 ,'#.##0,00'),
Because, there is no condition for non-selected one.
Can we write a code like if the get field selection is null the default consider year is max (year).hence based on year the below expression should work.Because I can not always select one value for year.
Is it possible to define ?
Off course, Why Not?
Red part is for selection, If you select 1 and more it will show Max year data that is green part else blue, It will show all values which are selections
=If(GetFieldSelections(Year)>0,num(avg({<[Year]={'$(=Max(Year))'}>} aggr(
if('$(vPerformance)'='Delivery',
if($(vAcceptableDaysDelayed) >= fabs( avg({<[Year]={$(=Max(Year))'}>} aggr( $(eDOT_DiffDel) , $(eAggrLevel1) )) ) ,1,0)
, ),[Purchasedoc], [Purchaseposition]))*100 ,'#.##0,00'),
num(avg(aggr(
if('$(vPerformance)'='Delivery',
if($(vAcceptableDaysDelayed) >= fabs( avg(aggr( $(eDOT_DiffDel) , $(eAggrLevel1) )) ) ,1,0), ),[Purchasedoc], [Purchaseposition]))*100 ,'#.##0,00'))
Yes your code is working for me.Thank you
But I'm little skeptical to use this big code in the front end.Because I need to use this formula $(vPerformance)'='Delivery', in 9 places 1 st tab and $(vPerformance)'='confirmation', 9 places in 2nd tab.
I guess this calculation is burden in the front end and leads to performance issue in future.
Regards,
Venkat
I don't think so, It won't kill the performance. Are you getting anything related performance problem?
This report has 6 tabs and mulyi langa.. dashboard.Supporting 4 countries.few charts are taking time to load.
I'm thing on the solution.
Regards,
Venkat
Sure, Instead Front end, create one Master Parameter table for multi languages supporting to USERS. That makes sense to keep update upon stage..
I don'know I'm using solution and creating the report.We will see if face any performance issue.
As of now Providing the solution is more important
Regards,
Venkat
Great, Now you can do your job !!!
Qlik Community Tip: Marking Replies as Correct or Helpful