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!

Filter Cross-Tab 1

Status
Not open for further replies.

merv02

Technical User
Dec 16, 2008
10
US
Hi,
I’m writing a report to show if a current employee were at the company any year within the past there years. Can someone please help me thanks.

I can create a ”cross-tab” that shows me what years they were at the company but my results need to look like the “final cross-tab”

cross-tab.gif
 
You want to show only employees who were employed in at least two years?

I think you'll need to use a 'mock-crosstab', probably too complex for a crosstab, though this might vary depending on your Crystal version.

You could group by employee and have running totals for each year. Show the resulst in the report footer. Right-click on fields and give the results borders if you want it to look like a crosstab. (If you're not already familiar with Crystal's automated totals, see FAQ767-6524. )

I think you'd have to show 2006, or at least have a gap for where it was suppressed.

An alternative method, if you use SQL and can code it as an SQL Command (Stored Procedure) would be to process in SQL and exclude the data you don't want. Then you could use Crystal as a front end and show the final file as a crosstab.



[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Create a formula {@multyr} like this:

if distinctcount({table.year},{table.ID}) >= 2 then
{table.ID}

Insert a group in your report on {table.ID} so that the group selection feature will work (suppress the group and detail section if you wish) and then go to report->selection formula->GROUP and enter:

distinctcount({table.year},{table.ID}) >= 2

Insert the crosstab in the report header or footer and use ID as the row, year as the column, and distinctcount of {@multyr} as the summary field.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top