Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
IF statement can only return one value
Can you explain what are you trying to achieve?
Your condition can be multiple
if(1=1 and 2=2...
Hi,
how do you plan to use those values?
Please provide an example.
regards
Marco
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.
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
instead
hope this helps
regards
Marco
Maybe use a many-to-many table instead.
Table:
LOAD * INLINE [
Currency, Division
Eur, 101
Eur, 201
AUD, 606
...
];
maybe like this:
table1:
LOAD *,
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:
LOAD *,
RecNo() as ID2
Inline [
Division
101
202
606
201
301
603
601
602
607
];
hope this helps
regards
Marco
Thanks Marco, appreciate the help and for your time.