2 Replies Latest reply: Jun 13, 2012 8:50 PM by ERICH SHIINO RSS

accessing text field by set analysis

atanumohanty

hi all

I am trying to access a field which contains text by following expression for specific dimension but unable to get the text instead it is showing 0

sum( {$<END_DT={'4/30/2009'}>}(CD_UNIT))

 

CD_UNIT  field contains texts like kwh or kvh or kw etc.

 

Any solutions to it ?

  • Re: accessing text field by set analysis
    Phil Bishop

    You do not want to use a sum() aggregation against a text field. Instead use Only(), minstring(), maxstring(), or something similar.  If you need to display more than one value, look into concat().
    -Phil

  • Re: accessing text field by set analysis
    ERICH SHIINO

    I agree with Phil but if you meant that in the field there are numbers with the unit in a string format, you will need to adjust it to make it a number.

    For example

    CD_UNIT = '500 W', '500 kW'

    You would need to convert it to the same unit in script:

    VALUE  = 500, 500000  / UNIT = 'W'

     

    Then, you would be able to sum it with your expression

    Hope this helps,

     

    Erich