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

Dynamic Number of Columns

Status
Not open for further replies.

codeFinder

Programmer
Jun 15, 2016
2
0
0
LK
thread149-575997

Regarding above thread I have dynamic number of employees as columns.How to deal with this?
Currently I have hard coated all of my employees as follows in the formula.

if ({command.EMP_NO} in ['219'to '512'])then 0
else if ({command.EMP_NO} in ['515'to '642'])then 1
else if ({command.EMP_NO} in ['678'to '736'])then 2
else if ({command.EMP_NO} in ['737'to '781'])then 3
else if ({command.EMP_NO} in ['791'to '840'])then 4
else if ({command.EMP_NO} in ['853'to '872'])then 5
else 6
 
I would create enough columns + a few extra. Then dynamically assign the employees to the columns.
 
@LaurieHamlin
Would you kindly illustrate it bit more.
How to count employees and add eight of them per group ?
A running distinct count of employees cannot be taken into the formula in crystal reports.
 
You must be dealing with a report and not a database. I'd make every effort to get access to the source table(s), since dealing with a cross tab report as an analytic source is a royal pain.

As an alternative, export/import into Excel and use the following process to normalize your data into a useable table.

Faq68-5287



Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
As I understand it, you are trying to have a Report/Page header appear on all pages when the cross tab extends vertically across pages.

This is not something I have ever needed to do but using Ken Hamady's solution to the referenced earlier thread, and depending upon the complexity of the Header you want displayed, one possible solution is to formula that contains the text and include that as the first column of the Cross Tab.

Hope this helps.

Cheers
Pete



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top