Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a chart were it lists the top 10 locations by Percentage change in production. This works just fine. The chart is sorted by top 10 and uses the below expression for percentage changed.
if(Sum( { $< [ProductionYear] = {'$(=GetFieldSelections([ProductionYear])-1)'} > } [actual_tons] )=0,
1
,
(Sum( { $< [ProductionYear] = {'$(=GetFieldSelections([ProductionYear]))'} > } [actual_tons] )
-Sum( { $< [ProductionYear] = {'$(=GetFieldSelections([ProductionYear])-1)'}> } [actual_tons] )
)/ Sum( { $< [ProductionYear] = {'$(=GetFieldSelections([ProductionYear])-1)'} > } [actual_tons] )
)
where I'm having trouble is getting the total tons of only the top ten based on the percentage changed. The expression works but the total is not accurate. varDifferenceInProductionVolume is the above expression.
//Current Version
sum({$< [ProductionYear] = {"$(=GetFieldSelections([ProductionYear]))"} , LocationID={"=rank($(varDifferenceInProductionVolume),4)<=10"} >} [actual_tons])
//Refined !!Not Accurate!!
//Sum( { < [ProductionYear] = {"$(=GetFieldSelections([ProductionYear]))"} > } [actual_tons] )
//simple test !!Not Acurate!!
//sum({<LocationID={"=rank($(varDifferenceInProductionVolume),4)<=10"} >} [actual_tons])
//Code found on the Community
//sum({<CLIENTFIELD={"=rank(sum(REVENUEFIELD),4)<=10"} >} REVENUEFIELD)
simply put how do I get the total tons from the top 10 plants by percentage changed.
In the attached image the total ton should be 3.18m not 1.07m in the Sum Top 10 KPI , however if I select the all ten locations the total is correct.
Thanks for the help in advance
Maybe you can use the rank() function to calculate the top 10?
Morgan Kejerhag
Senior Business Intelligence Consultant
Drake Analytics
http://www.drakeanalytics.se
I am using the rank function inside the set analysis section.