IIF expression
-
- Posts: 8
- Joined: Tue Oct 10, 2017 12:44 pm
IIF expression
I have recently started using R&R. I was used to using if then else formulas in crystal reports. How would i create an espression in R&R like the following:__if {cng01.cng01_typ} = 100 then "Customer Information" else__if {cng01.cng01_typ} = 200 then "Location Information" else__if {cng01.cng01_typ} = 300 then "Service Information" else__if {cng01.cng01_typ} = 400 then "Pricing Change" else__if {cng01.cng01_typ} = 500 then "Pricing Change" else__"Other"____I would very much appreciate your help.__thanks,
-
- Posts: 35
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: IIF expression
While this can be done by__IIF(cng01.cng01.typ = 100, "Customer Information", __IIF(cng01.cng01.typ = 200, "Location Information",__IIF(cng01.cng01.typ = 300, "Service Information",__IIF(cng01.cng01.typ = 400, "Pricing Change",__IIF(cng01.cng01.typ = 500, "Pricing Change","Other)))))____Having said this, I personally would use the CASE statement. A little easier to construct and does the same thing. No need to keep up with the ")". (:-})____CASE(cng01.cng01.typ, 100, "Customer Information", 200, "Location Information", 300, "Service Information", 400, "Pricing Change", 500, "Pricing Change, "Other")____Either way, not too bad. God Luck. The CASE statement and the IIF are fully documented in the help files. ____note: A parenthesis is replaced by a smiley face in the post.
-
- Posts: 8
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: IIF expression
Thanks very much for your help.