SSRS Contains and Like Expressions

  • I'm trying to create a calculated expression from a field in my dataset. I need to find everything that contain the word Exchange Traded from one field and in my new field have the words 'ETF 13F'. If nothing matches then it would just be blank.

    I have tried the Like("*Exchange Traded*") and Contains ("*Exchange Traded*") functions and when running the report I get a #error in my new field.

    Here's what I have tried...

    =IIf(Fields!DESC2.Value.like("*Exchange Traded*"),"ETF_13F", false)

    How do I write this wildcard expression and then replace with a different text in the new calculated field?

    Thanks in advance,

  • I figured it out. I added a case expression in my sql and then added it to my query in SSRS.

    (case when c.desc2 like '%exchange trade%' then 'ETF 13F' else '' end) as SEC_Class_ID

    Works great.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply