Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OR in StrIFF 1

Status
Not open for further replies.

ldoodle

IS-IT--Management
Jan 18, 2012
2
GB
Hello,

I am totally new to QRPs but our finance app uses them to generate invoices. We have a requirement where we want to output a string based on the value of something taken from the app.

From what I can gather, StrIFF returns 3 values: -1 if the input value is lower than the comparitor, the input value if it equals the comparitor, and the value higher than the input value. Take this as the input value: AUD

StrIFF(StrCompare(inputvalue, 'GBP'), '1', '2', '3')

In this case the result will be 1, because AUD is alphabetically before GBP. IF the inputvalue was USD, the result would be 3.

What I need to achieve is: if the inputvalue is either AUD, NZD output 'W', if it's GBP, EUR output 'X', if it's HKD, JPY output 'Y', if it's CAD output 'Z' and so on and so on.

How do I achieve this?

Thanks so much!

 
Greetings from NZ !
And welcome to Gupta ReportBuilder. Hang in there it does get easier.

Try:
StrTranslate(inputvalue, 'AUD,NZD,GBP,EUR,HKD, ....','W, W, X, X, Y, ....')

Syntax

StrTranslate(inputvalue,csv1,csv2)

Finds the value specified by inputvalue in csv1. The function takes the position of the item in csv1 and finds and returns the item in csv2 that is in the same position.

Parameters


inputvalue: The comparison variable. Must be a string data type.

csv1: A string composed of comma delimited look-up values. The contents of type are compared to this list. For example, 'N,S,W,E'.

csv2: A string composed of comma delimited values, one of which is returned by the function. For example, 'North, South, West, East'.

Example

StrTranslate (region, 'N,S,W,E', 'North, South, West, East')

In this example, region is an input item with a data type of string. The StrTranslate function returns one of the following depending on the value of inputvalue.

inputvalue substring returned

N North
S South
W West
E East



Greetings from New Zealand !
GuptaSteve

See Bankside Systems Ltd for all Gupta / Centura SQLWindows / SQLBase help at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top