5 Replies Latest reply: May 2, 2012 7:52 AM by jagan mohan RSS

    suming variables in expressions

    alphez77

      Hi guys,

       

      I saw in a qlikview example "whats new in qlikview 11" that you could create "slect one metric" for sales, quantity, margin...etc..

      The way they did it:

      MetricsOptions:

      LOAD * INLINE [_metricsNo, _metrics

      1, Sales,

      2, Qty,

      3, Margin

      4, Margin%

      ];

       

      MetricPickOne:

      LOAD DISTINCT

          _metrics as _metricPickOne

      RESIDENT MetricsOptions;

       

      My question is, if I wanted to sum up sales in a expression but don´t want to hardcode sum(sales) but instead wanted to use the Metrics Options, how do I do that? I tried sum(_metricPickOne) but that didn´t work.

      I know I can use condition and say _metricPickOne = 'sales'     than sum(sales) but what if I have more than 10 metrics? Is there another way?

       

      Regards,

      alphez