Count and change name

D

Dan @BCBS

Could someone please help me add these together into a text box on a report.
After I count the results (a) I need to change the name (b).

(a). This code give me a count per location:
="Total for Location:" & " " & [TR_GBU] & " (" & Count(*) & " " &
IIf(Count(*)=1,"Cases","Cases") & ")"

(b).This code groups the location and changes the name:
IIf([tr_gbu]="SE" Or [tr_gbu]="EC","MIAMI",IIf([tr_gbu]="NC" Or
[tr_gbu]="NE" Or [tr_gbu]="NW" Or [tr_gbu]="WC" Or
[tr_gbu]="SW","JACKSONVILLE",Null))

Any advise would be appreciated.
 
O

Ofer Cohen

(a). This code give me a count per location:
="Total for Location:" & " " & [TR_GBU] & " (" & Count(*) & " " &
IIf(Count(*)=1,"Cases","Cases") & ")"

The IIf return "Cases" in both case, I assume you want to change it to

="Total for Location:" & " " & [TR_GBU] & " (" & Count(*) & " " &
IIf(Count(*)=1,"Case","Cases") & ")"

*****

(b).This code groups the location and changes the name:
IIf([tr_gbu]="SE" Or [tr_gbu]="EC","MIAMI",IIf([tr_gbu]="NC" Or
[tr_gbu]="NE" Or [tr_gbu]="NW" Or [tr_gbu]="WC" Or
[tr_gbu]="SW","JACKSONVILLE",Null))

To make it shorter

=IIf([tr_gbu] In ("SE" ,"EC"),"MIAMI",IIf([tr_gbu] In ("NC" ,"NE" ,"NW"
,"WC","SW"),"JACKSONVILLE",Null)

**************************

Now, what do you mean abou changing the name?

Do you want to join them together?

="Total for Location:" & " " & [TR_GBU] & " (" & Count(*) & " " &
IIf(Count(*)=1,"Case","Cases") & ") " & IIf([tr_gbu] In ("SE"
,"EC"),"MIAMI",IIf([tr_gbu] In ("NC" ,"NE" ,"NW"
,"WC","SW"),"JACKSONVILLE",Null)
 
D

Dan @BCBS

Fantastic - Thank you.......

Ofer Cohen said:
(a). This code give me a count per location:
="Total for Location:" & " " & [TR_GBU] & " (" & Count(*) & " " &
IIf(Count(*)=1,"Cases","Cases") & ")"

The IIf return "Cases" in both case, I assume you want to change it to

="Total for Location:" & " " & [TR_GBU] & " (" & Count(*) & " " &
IIf(Count(*)=1,"Case","Cases") & ")"

*****

(b).This code groups the location and changes the name:
IIf([tr_gbu]="SE" Or [tr_gbu]="EC","MIAMI",IIf([tr_gbu]="NC" Or
[tr_gbu]="NE" Or [tr_gbu]="NW" Or [tr_gbu]="WC" Or
[tr_gbu]="SW","JACKSONVILLE",Null))

To make it shorter

=IIf([tr_gbu] In ("SE" ,"EC"),"MIAMI",IIf([tr_gbu] In ("NC" ,"NE" ,"NW"
,"WC","SW"),"JACKSONVILLE",Null)

**************************

Now, what do you mean abou changing the name?

Do you want to join them together?

="Total for Location:" & " " & [TR_GBU] & " (" & Count(*) & " " &
IIf(Count(*)=1,"Case","Cases") & ") " & IIf([tr_gbu] In ("SE"
,"EC"),"MIAMI",IIf([tr_gbu] In ("NC" ,"NE" ,"NW"
,"WC","SW"),"JACKSONVILLE",Null)



--
Good Luck
BS"D


Dan @BCBS said:
Could someone please help me add these together into a text box on a report.
After I count the results (a) I need to change the name (b).

(a). This code give me a count per location:
="Total for Location:" & " " & [TR_GBU] & " (" & Count(*) & " " &
IIf(Count(*)=1,"Cases","Cases") & ")"

(b).This code groups the location and changes the name:
IIf([tr_gbu]="SE" Or [tr_gbu]="EC","MIAMI",IIf([tr_gbu]="NC" Or
[tr_gbu]="NE" Or [tr_gbu]="NW" Or [tr_gbu]="WC" Or
[tr_gbu]="SW","JACKSONVILLE",Null))

Any advise would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top