Monday 2 July 2012

Highest value in the narrative view/ Rank

We needed to show the Highest value for a measure column in the narrative view. The report for example will consist of two columns- dimension and measure column.
I placed a dummy column for finding the highest value of the measure by using RANK function in the column formula and calculating its position using javascript.


First will drag a dummy column of the measure and use the rank function as shown below-




Next will be using javascript to calculate the appropriate position of the 1st highest value of the measure column.




<script language="javascript" type="text/javascript">
for(var i=0;i<1;i++)
{
var a=@3;
if(a==1)
{
document.getElementById("Format").innerHTML='Biggest Profit-->@2';
}
}
</script>



And save and view the result...




Comments are always welcome...

1 comment:

Thanks to Comment
--Add--