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

Fromula ignoring filters 1

Status
Not open for further replies.

Ladyazh

Programmer
Sep 18, 2006
431
US
Please, help, while day wasted.

Formula
If ({t.CODE}='MKT') OR
({t.CODE}='MBR') OR
({t.CODE}='COM') then
DistinctCount({t.CUSTOMER_ID},{t.CDS})

completely ignores 'MKT' and 'MBR' and 'COM'

Is there mistake? Thanks
 
To simplify this process, use a Running Total and select distinct count for the customer id, group by the CDS field, and in the evaluate use a formula place:

{t.CODE} in ["MKT", "MBR", "COM"]

-k
 
The trick is that I am going to need to manipulate all those values later. Will I be able to?

And why is this happening? Any ideas?
Thanks for the tip, I will try.
 
Your formula says that if any of those conditions exist, then do a distinctcount of ALL rows, it isn't filtering.

And yes, you can use a Running Total in a subsequent section.

-k
 
How do I say if these conditions exist - count only those where conditions are true?
OOps! I can use your If...then...true formula!
Thanks
 
Hi again,
I just thought that yes, this is what i need is
"if any of those conditions exist, then do a distinctcount of ALL rows by the t.CDS group".

This is what i want but it is ignored.
If I will place 'MKT' and 'MBR' and 'COM' in Record Selection it will take it but not in the formula. Why?
 
You need to insert a running total where you select distinct count of customer ID, and then select "Use a formula" in the evaluation section:

{t.CODE}='MKT' OR
{t.CODE}='MBR' OR
{t.CODE}='COM'

Then choose reset on change of group: {t.CDS} group. Place the running total in the group footer. This will give you a distinct count of those customers who have one or more of the above codes.

Your original formula, if placed in a group footer, would only give you the distinct count of ALL customer IDs in the group--if the last record in the group met your criteria.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top