If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

IF syntax question...

Started by donap, 15 Dec 2017 11:11:29 AM

Previous topic - Next topic

donap

I want to write the following code in a TI Process -- but it keeps telling INVALID OPERATOR....


If ( vTestvalue in ('ABC', 'XYZ', 'MNL', 'rrr', ZZZ')  & vType @= vTestType2 ) ;
    DimensionElementComponentAdd (sDim, '',vTestValue,weight) ;
endif;


Is it that TM1 does not allow use of the  "IN"  clause  ???

Thanks

AJAYC

This is correct, there is no "IN" clause.

You need to test your items within the brackets individually against vTestvalue. You can do this simplistically eg.

IF (
       ( vTestvalue @='ABC' %
         vTestvalue @='XYZ' %
         vTestvalue @='MNL' %
         vTestvalue @='rrr' %
         vTestvalue @=ZZZ' )
       &
         vType @= vTestType2 ) ;

         DimensionElementComponentAdd (sDim, vConsolidation, vTestValue, sWeight) ;

ENDIF;


The "%" represents an "OR" function. I noted you missed a parent value, so have added "vConsolidation" in your DimensionElementComponentAdd statement.

HTH
Ajay