Skip to Content
author's profile photo Former Member
Former Member

match function

Hi everyone.

I have dimension where I should select by contract numbers.

Purchase contracts begin with P and looks like P00934875

Sale contracts begin with S and looks like S_238098346237

I want to create variable and group all purchase or sale contracts.

I use match function and create different variables like

=If Match([Contractno];"%p%") Then "Purchase" ElseIf

Match([Contractno];"%S%") Then "Sale"

another variable

=if Match ([Contractno];"p*") Then "Purchase" ElseIf

Match([Transrefid];"s*") Then "Sale"

no one of these help me. What is correct syntax for match function? Please help me with this issue.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 20, 2015 at 01:09 PM

    Use Left instead:

    =If(Left(Upper([Contractno]);1)="P";"Purchase";If(Left(Upper([Transrefid]);1)="S";"Sale"))

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 20, 2015 at 12:43 PM

    Hi,

    Use this.

    =if (Match ([Contractno];"P*"))Then "Purchase" ElseIf

    Match([Transrefid];"S*") Then "Sale"

    Check the values are in CAPS or lower.

    Amit

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.