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

Formula to remove duplicates

Status
Not open for further replies.

natetc

Technical User
Nov 4, 2010
21
CA
I don't know if this is possible but please let me explain and let me know if there is a formula for it.

Here is a simple example, time=column 1, fruit=column 2

Time-Fruit
13:00-Apple
14:00-Oranges
13:00-Apple
15:00-Grape
16:00-Apple

I want a formula that will remove the duplicate (13:00-Apple) and only keep 1 entry of this.

Is there any way? Thanks in advance!
 
Insert a group on:

totext({table.time},"HH:mm")+"-"{table.fruit}

Then place your fields in the group header or footer.

-LB
 
So from your example just put the two fields in the formula to eliminate duplication?

totext{WB3.KEY}+{WRKLOB.ACT}

I tried a variation and it states that "there is an error in this formula. Do you want to save it anyways?
 
Hi,
Use parens as in LB's example:

totext({WB3.KEY})+{WRKLOB.ACT}



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
You should try the formula exactly as I showed, adding the formatting as I did, and just substitute the time or datetime field for {table.time} and your fruit field for {table.fruit}.

-LB
 
Hi turkbear/LB,

I've tried

totext({WB3.KEY})+{WRKLOB.ACT}

However, it doesn't appear to do anything in the output even though I am able to input it in as a formula without error.

I'm a beginner at this, can you define what "totext" does?
 
'ToText' turns a data or number into text, meaning that it can be included in text.

Having got the formula, use it to group, as lbass originally told you. You should find 'Group' on the menu under 'Insert', and it also has an icon.

Once you have a group, move the display fields to the group header or footer. Suppress the detail section - right-click on the margin of a section for this and other options.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
What is the name of your time field? Also, if you run your mouse over the field, what datatype is identified in the tooltip?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top