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 A="EL" then A="Electrical"

Started by Esosa, 19 Nov 2019 08:31:37 AM

Previous topic - Next topic

Esosa

Are if statements possible to switch the content of a string?

Lets say ServiceType = "EL" meaning that it is an Electrical Service Type. Is it possible to tell cognos to display in the report "Electrical" if ServiceType is equal to "EL" and "Water" if ServiceType is equal to "WTR"?




Thank you in advance

BigChris

IF and CASE statements both work fine in Cognos

if([ServiceType] = 'EL') then ('Electrical') else (if([ServiceType] = 'WTR') then ('Water') else ('Undefined'))

case ServiceType
  when 'EL' then 'Electrical'
  when 'WTR' then 'Water'
  else 'Undefined'
End