3 Replies Latest reply: Jul 1, 2014 3:49 AM by Marco Wedel RSS

    Formatting numbers with VBscript function

    Mark Sheraton

      I'd like to write a VBscript function to format numbers and use it within chart expressions.  Could someone provide the correct syntax
      (Appreciate the below code includes num() which is not vb script)

       

      function formatNumber(parameter)

       

      if(parameter > 1000000
      or $parameter < -1000000
      ,num((parameter / 1000000),'#,##0 Mil')
      ,if(parameter > 1000
      or parameter < -1000
      ,num((parameter / 1000),'#,##0 K')
      ,num($1,'#,##0')
      ))

       

      end Function

       

       

      Regards

      Mark

       

      Message was edited by: msheraton After reading QlikView Automation Reference it appears user defined functions cannot be called in Expressions.  So I'll have to do this another way...