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

can i use the result of a formula to select certian records 1

Status
Not open for further replies.

sandeejh

Technical User
Feb 12, 2010
8
US
Hello
I have a formula in the group footer that displays all the detail results on one line:The formula is part of a 3 step formula.The final formula which displays the details all on one line is called @display formula.
Example
D1 A
D2 B
D3 C
// I now have them displaying on the group footer as A,B,c
what i would like to do, is if there is a B in the results then "good" will show.Can I do something like the following//
@display formula
if "B" then "good" else ""

// also I need to export to excel for final evaluation. so i need the report to be clean and on one line. That's why i have the A,B,C on one line.And if i used the filter selection to select only "B" the formula which sums the amount for A,B,C will only calculate the "B" amount..///


I'm i close????
Thanks


 
You should be able to use a formula like this:

if "B" in {@display} then "Good"

Or: if {@display} like "*B*" then "Good"

The only issue would be if by "B" you really mean some value that could be found in combination with other elements, e.g., if B was really "Brown" and if {@display} could contain words like "Browning", "Browner", etc. Then you'd have to approach this a little differently.

-LB
 
thank you for responding,when i try to use the formula you suggested the error message comes up highlighting {@display formula} and says "the field name is not known".

is there another step to it? I copied and paste the formula you suggested. I applied the correct formula name and value name.

any help is greatly appreciated!
 
You need to substitute the name of the formula you are using in the group footer that results in: A,B,C for "{@display}".

-LB
 
okay this is what i did:

ItemA
ItemB
ItemC


1) Group Header I placed @reset formula:

WhilePrintingRecords;
StringVar chain := '';
NumberVar ChCnt := 1


2) Details I placed @Accum formula, putting your field into the second line:

WhilePrintingRecords;
StringVar Item:= {Your.Field};
place of {Your.Field}
StringVar Chain;
NumberVar ChCnt;

if ChCnt = 1
then (ChCnt:= 2; chain := Item)
else
if Length(Chain) + Length(Item) > 254
then Chain := Chain else
chain := chain + ', ' + Item


3) On the Group Footer I placed @Display formula:

WhilePrintingRecords;
StringVar Chain

prints out as one line like:

ItemA, ItemB, ItemC
//I'm looking for a formula that will evaluate the results of formula 3(the one line) and if ItemB is one of the three then a want a message on the group header to say "GOOD"//

I've come so far with this report... Management keeps changing their mind on what they want the report to look like... UHG!!!!Driving me crazy.Just when i think i'm done ..
Well once again any help would be greatly appreciated
Sandee
 
You should be able to just use a formula like this:

if <the name of your #3 formula here> like "*B*" then "Good"

Place this in the group footer. If you still can't get this to work, then copy and paste your actual formula into this thread and please tell me the exact name of your display formula in #3 above.

-LB
 
Thank You LB for all your Time and Help. Got to work this morning and gave the formula one more try and noticed that I was spelling the formula wrong. OMG I am a silly monkey. My original formula was spelled dispaly formula BIG TYPO and i kept typing @display formula....

One more question, if you don't mind. How do i get the report to show more then "*B*". If i want the formula result to show B and C how would i write it?
Thank you again... got to watch my typing,crazy fingers!
sandee
 
I'm confused--I thought you wanted the formula to show "Good" if certain criteria were met. Are you saying you want it to show "Good" if the condition is either B or C? Or if both B and C are present? Or?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top