Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Calculated Field - looking for certain text

Posted on by 30

I am building a CASE formula and want to base it off of if there is certain text in a field, specifically the letters "MG" that will be next to each other. I have tried contains and cannot figure it out. 

Thank you for your help! 

Categories:
  • DebraH Profile Picture
    DebraH 30 on at
    RE: Calculated Field - looking for certain text

    Hi David, Almas

    This was a calc field for a Smartlist. I figured it out last night!

    I was able to use "substring" : WHEN SUBSTRING ({Account Transactions:Description},10,1)="M"  .

    Thank ya'll for your help!!!

  • Suggested answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Calculated Field - looking for certain text

    Hi David,

    Yeah that's what I was thinking , we don't know until Debra explained the complete condition and that's why I said it would be a complicated one for report writer level.

    RW Functions either from GP Power Tools or Dexterity will be more flexible and could cover more cases easily,

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,926 Most Valuable Professional on at
    RE: Calculated Field - looking for certain text

    Hi Almas

    It will require multiple calculated fields, but nested conditional calculated fields can create the equivalent of a case statement.

    It would probably help if Debra explained the end result.

    Also with GP Power Tools you can create custom RW functions that can look at any data or perform any calculation.

    Regards

    David

  • Suggested answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Calculated Field - looking for certain text

    Hi DebraH,

    It sounds more complicated to be carried out in report writer (if you are talking about report writer).

    In my opinion it will take you to create multiple calculated fields and even not sure if it will work.

  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,926 Most Valuable Professional on at
    RE: Calculated Field - looking for certain text

    Hi Debra

    I am assuming this is for a Report Writer calculated field.

    You can use the User Defined function RW_Pos() in the system series

    function returns integer OUT_pos;
    in string IN_target; { The string you want to search in }
    in string IN_search; { The string you want to search for }
    in integer IN_start; { The position at which the search will start in the target string }

    If it returns > 0 then the letters you are searching for exist in the string.

    Hope this helps

    David

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans