4 Replies Latest reply: Jul 15, 2011 6:52 AM by Razor Ramon RSS

    Dynamic Chart Macro and Number Format Problem

      Hi guys,

       

      I have used a macro flying around on the forum for a dynamic chart that gets updated depending on the dimension selected. This works fine.

      The problem I now have is that I get my numbers displayed as 10000000.

      I managed to do something in the macro as suggested here in http://community.qlik.com/message/9628#9628 to get my numbers showing as 1,000,000,000.

      See code snippet from the link provided

      set chart = ActiveDocument.Sheets("Main").CreateStraightTable

      chart.AddDimension "ProductType"

      chart.AddExpression "sum(Amount)"

      set p = chart.GetProperties

      set np = p.Expressions.Item(0).Item(0).Data.ExpressionVisual.NumberPresentation

      np.Dec = "."

      np.Fmt = "# ##0.00"

      np.nDec = 2

      np.Thou = " "

      np.Type = 11 'fixed decimal

      np.UseThou = 1

      chart.SetProperties p

       

      The problem I have is that I would like the macro to display my values as 1b instead of 1,000,000,000 and 1m instead of 1,000,000 and 1k instead of 1,000

       

      Does anyone know how to get this to work in the macro? Apologies for my vague question, as I don't know much about macros.

       

       

      Thanks