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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable question

Status
Not open for further replies.

KenSimmons

Programmer
Nov 26, 2003
17
US
I am trying to create a variable based on an if in.

If(number in ("1","2"),"0","1") but this is appartly not the correct sytax. Is there an easy way to do this?
 
Because it is a number, you shouldn't really have ""
If(<variable> inlist (1,2)) then &quot;0&quot; else &quot;1&quot;

BO has different syntax for IF statements than MS prducts

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Will it work with a object?

If(<Object> inlist (1,2)) then &quot;0&quot; else &quot;1&quot;
 
No reason why not - the exact syntax will depend on whether your object is defined as a string or a number.
For a string:
If(<Object> inlist (&quot;1&quot;,&quot;2&quot;)) then &quot;0&quot; else &quot;1&quot;

For a number:
If(<Object> inlist (1,2)) then &quot;0&quot; else &quot;1&quot;

(as you had it)

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
The problem is that is is in the WEBI environment, not the full client. Is there a way to do it in the WEBI environment?
 
gonna have to pass the buck here I'm afraid - no experience of WEBI

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
I have to assume you are trying to do this in WebI 6.x. Since you can't build formulae in 2.7, it's a pretty safe assumption.

Unfortunately, there is not &quot;In&quot; operator in WebI. When you see &quot;In&quot; in the formula wizard, it is used for extended syntax like &quot;In Body&quot; or &quot;In Report&quot;.

Also, I'm sure you've noticed by now that referencing a variable or object in a WebI formula looks like [object] not <object>. Also, I'm sure you've noticed that the parameter separator is a semicolon, not a comma.

Steve Krandel
Westbay Solutions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top