Announcements
cancel
Showing results for
Did you mean:
Not applicable

## IF statement, that can return 2 values if the condition is true

Hello;

I am trying to create an IF statement, that can return 2 values if the condition is true

for example:

if(1=1 , 'true1' and 'true2' , 'false')

appreciate any help.

thanks

Kumar

7 Replies
Master III

IF statement can only return one value

Can you explain what are you trying to achieve?

if(1=1 and 2=2...

MVP

Hi,

how do you plan to use those values?

regards

Marco

Not applicable
Author

Hello Robert:

I am trying to achieve the following

if( Currency = 'Eur', '101',
if( Currency = 'Eur', '202',

if(Currency = 'AUD', '606',

if(Currency = 'PLN', '201',

if(Currency = 'MXN', '301',

if(Currency = 'NTD', '603',

if(Currency = 'CNY', '601',

if(Currency = 'KRW', '602',

if(Currency = 'JPY', '607',
)))))))))
as "Division"

For value where the Currency is Eur I would like to have 2 divisions (101 & 202) so as to be connected to

another table.

MVP

Hi,

you could try

Subfield(Pick(Match(Currency, 'Eur','AUD','PLN','MXN','NTD','CNY','KRW','JPY'),'101-202','606','201','301','603','601','602','607'),'-') as Division

hope this helps

regards

Marco

Anonymous
Not applicable
Author

Maybe use a many-to-many table instead.

Table:

Currency, Division

Eur, 101

Eur, 201

AUD, 606

...

];

MVP

maybe like this:

table1:

Subfield(Pick(Match(Currency, 'Eur','AUD','PLN','MXN','NTD','CNY','KRW','JPY'),

'101-202','606','201','301','603','601','602','607'),'-') as Division

Inline [

ID1,Currency

1,MXN

2,Eur

3,PLN

4,MXN

5,MXN

6,AUD

7,MXN

8,KRW

9,CNY

10,MXN

11,AUD

12,MXN

13,MXN

14,Eur

15,CNY

16,JPY

17,NTD

18,MXN

19,JPY

20,JPY

21,MXN

22,JPY

23,AUD

24,JPY

25,MXN

26,MXN

27,CNY

28,NTD

29,JPY

30,MXN

];

table2:

RecNo() as ID2

Inline [

Division

101

202

606

201

301

603

601

602

607

];

hope this helps

regards

Marco

Not applicable
Author

Thanks Marco, appreciate the help and for your time.

Community Browser