BrickBrock
November 6th, 2007, 02:38 PM
Do you know if there is a way to create a condition based on which section in the report that a formula is placed (yeilds a different result if it is located in Detail a, Detail b, or Details c sections)?
I have a data set that (among many other columns) has 3 columns titled Rep1, Rep2, and Rep3 for each record. I want to group my report for every rep code in the records - that code may be found in any one of the columns Rep1, Rep2, or Rep3. (I have done this for a single rep code using the selection expert, but I need to get the report to generate for all rep codes and to group by specific rep codes). This means that a single record may need to be used in up to 3 different groups.
What I am trying to do is write a conditional formula. I want to call it 'TrueRepCode'. I am not sure how to write the condition (I would like this condition to be based on where the formula is located in the report). I was hoping to do something like:
if this field is in 'Details a' then Rep_1 else
if this field is in 'Details b' then Rep_2 else
If this field is in 'Details c' then Rep_3
This would allow me to group by 'TrueRepCode' and then I could run the report and group it right in Crystal and not have to worry about exporting to excel. Even if I did have to export it to excel, once the grouping is done, the number of records would me much smaller and I could manage it in 1 export.
As an alternate, is there a way that a formula can be written that will just show the information from an adjacent field? So I could write a formula that would show me the results of the field to the left. I would place this formula in each of my 3 details sections to the right of my Rep_1, Rep_2, and Rep_3 data. Again, this would give me a formula to group by (so I could capture every time a given rep code appears in Rep_1, Rep_2, or Rep_3 column and combine them all).
Thanks for your help,
Brick
I have a data set that (among many other columns) has 3 columns titled Rep1, Rep2, and Rep3 for each record. I want to group my report for every rep code in the records - that code may be found in any one of the columns Rep1, Rep2, or Rep3. (I have done this for a single rep code using the selection expert, but I need to get the report to generate for all rep codes and to group by specific rep codes). This means that a single record may need to be used in up to 3 different groups.
What I am trying to do is write a conditional formula. I want to call it 'TrueRepCode'. I am not sure how to write the condition (I would like this condition to be based on where the formula is located in the report). I was hoping to do something like:
if this field is in 'Details a' then Rep_1 else
if this field is in 'Details b' then Rep_2 else
If this field is in 'Details c' then Rep_3
This would allow me to group by 'TrueRepCode' and then I could run the report and group it right in Crystal and not have to worry about exporting to excel. Even if I did have to export it to excel, once the grouping is done, the number of records would me much smaller and I could manage it in 1 export.
As an alternate, is there a way that a formula can be written that will just show the information from an adjacent field? So I could write a formula that would show me the results of the field to the left. I would place this formula in each of my 3 details sections to the right of my Rep_1, Rep_2, and Rep_3 data. Again, this would give me a formula to group by (so I could capture every time a given rep code appears in Rep_1, Rep_2, or Rep_3 column and combine them all).
Thanks for your help,
Brick