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

Running total when two data types are similar formula 1

Status
Not open for further replies.

12345ITguy

IS-IT--Management
May 24, 2011
5
NZ
Hi All,

Sorry if my request seems basic- I am a beginner

I have a set of data with the following fields-

Blue Slow Car
Red Car
Slow Car

I have running total formula as below

InStr({C_CAR.TYPE}, "Slow") > 0

The problem with this forumla is that it counts the "Blue Slow Car" and "Slow Car" together, I would like to count the "Slow Car" only.

What would be the best formula to do this? Any help is appreciated, I know there is an easy answer but it is eluding me right now.

Thanks,
 
Using SPLIT and UBOUND, you could get the last two elements when there are three or more. You could then get the desired result using Distinct Count.

It depends on the other data: e.g. it would fail with "Green Slow Car Stopped"

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
In Running total formula use a formula like

if {C_CAR.TYPE} like "*Slow" then true else false
 
In the evaluate formula you do not need to spell out true false

you can use just

{C_CAR.TYPE} like "*Slow"

This will return true and evaluate RT.

However, this formula will not help as both Slow car and Blue slow car will be true.

you should use

{C_CAR.TYPE} like "Slow*"


Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top