cancel
Showing results for 
Search instead for 
Did you mean: 

match function

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use Left instead:

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

Former Member
0 Kudos

Great solution. Thank you very much

Answers (1)

Answers (1)

amitrathi239
Active Contributor
0 Kudos

Hi,

Use this.

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

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

Check the values are in CAPS or lower.

Amit

Former Member
0 Kudos

Hi Amit. Thank you for your response. I try both uppercase and lowercase but both of them turn no result.