0 Replies Latest reply: Feb 12, 2017 11:15 PM by Carlos Reyes RSS

    Number scalation using variable parameters

    Carlos Reyes

      Hi,

       

      I'm trying to use variable parameters to include number escalation in the master measures definition. For that I'm using rwunderlich method explained here and d.pranskus  workaround for the comma issues explained here.

       

      So far the number scalation seems to be working in the Text object, but is not for the the default kpi object that comes with Sense. This object is deleting the 'M' or 'K' characters that are displayed at the end of the number when the the result of the calculation is over millions or thousands.

       

      I was begining to think that maybe Sense was not compatible with this qlikview ninja trick, but I tested the master measures defined with this method in a widget (from the demo team widget library) and it worked!!! So... I'm guessing there's a bug or a limitation in the default kpi object. Can anyone confirm to me what's the issue here? Is it a bug? Or... haha... is it working as designed?

       

       

      test.png

       

       

       

       

      The variable and master measures are the following:

       

      vScaleNumber (variable)

       

      if($(=REPLACE('$1', ';', ','))>1E6,num($(=REPLACE('$1', ';', ','))/1E6,'#,##0.0 M'),if($(=REPLACE('$1', ';', ','))>1E3,num($(=REPLACE('$1', ';', ','))/1E3,'#,##0.0 K'),num($(=REPLACE('$1', ';', ',')),'#,##0')))

       

       

      Sales Measure without number scalation (master measure)

       

      Sum(Sales)

       

       

      Sales Measure with number scalation using an IF (master measure)

       

      if(Sum(Sales)>1E6, num(Sum(Sales)/1E6,'#,##0.0M')

      ,if(Sum(Sales)>1E3, num(Sum(Sales)/1E3,'#,##0.0K')

      ,num(Sum(Sales),'#,##0')

      ))

       

      Sales Measure with number scalation using variable with parameters (master measure)

       

      $(vScaleNumber(Sum(Sales)))

       

       

       

      I'm enclosing my qvf file and the widget extensions so anyone can review the issue and correct me if I'm making a dumb mistake.

       

      Thanks.