web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SSRS: Replace Value returned with text

(0) ShareShare
ReportReport
Posted on by

Hi guys,

I'm putting another report together (thank you for your help so far Andrii!) and it appears that the filtered view of one of our custom entities does not have a column called PaymentMethodName which exists on the UNfilteredview.

I've managed to get my expression to return values such as 09080001, 09080002 but was hoping to replace these with Credit/Debit Card etc.  I thought about using IIF or SWITCH like I have with conditional formatting, but can't seem to get this to work. I did try Replace too but I think it's fair to say I misunderstood that. 

The expr for the field is referencing a different dataset as it is, so perhaps I'm just not nesting it correctly.  Expression for the Payment Method at present is

=lookup(fields!membershipid.value, fields!membershipid.Value, fields!paymentmethod.Value, "Payment")

 Is this possible? 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Have you tried to put decoding directly to your query? This is a good example - usage of Case - https://docs.microsoft.com/en-us/sql/t-sql/language-elements/case-transact-sql

    Another option is join to FilteredStringMap view that contains all the required labels.

  • Suggested answer
    Preeti Sharma Profile Picture
    2,678 on at

    Hi,

    You can simply apply iif statement to replace value with text as below:

    iif(fields!paymentmethod.Value=09080001,"Credit",iif(fields!paymentmethod.Value=09080002,"Debit ","Master"));

    Basic syntax is :

    iif(<field!xyz.value>=<somevalue>,<then do this>,iif(<field!xyz.value>=<somevalue1>,<then do this>,<elsedothis>))

    Aslo, for applying lookup below link may help you:

    1. http://bidn.com/Blogs/lookup-and-lookupset-functions-new-in-ssrs-2008-r2

    2. https://docs.microsoft.com/en-us/sql/reporting-services/report-design/report-builder-functions-lookupset-function

    Hope this helps:)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans