Create List in Formulas
Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22809
Printed Date: 18 Apr 2024 at 10:48am
Topic: Create List in Formulas
Posted By: anoble1
Subject: Create List in Formulas
Date Posted: 07 Aug 2019 at 10:46am
How can i create a list in the Formulas area?
For instance.
If ZIP codes are [35452,24785,95742,74565] Then "Chambers" County
else if [45844,58745,35471] then "asdf County" ETC.
How do I write that?
I have about 50 zip codes that I am going to compress together by county and list the County on a Group Header to group all the zips for that one county all the way down.
|
Replies:
Posted By: Sastry
Date Posted: 10 Aug 2019 at 12:17am
HI
Your question is having the answer, only thing is need to use correct syntax:
If {zipcodefile} in ['35452','24785','95742','74565'] Then "Chambers"
Else
If {zipcodefile} in ['45844','58745','35471'] Then 'ASDF'
Else
If .. so on..
Since zip code filed always be in string data type you need to put them in single /double cots.
Insert group on above formula to group all related countries.
------------- Thanks,
Sastry
|
|