Joined: 08 Feb 2013
Online Status: Offline
Posts: 22
Topic: String data on each row Posted: 12 Jun 2013 at 3:45am
I am trying to get one row per phase with multiple cost types, but the result is just the first cost type. Phases may be set up with all cost types or a select few. Below is what I am trying to accomplish:
Phase 505-451 Cost type 1,2,4,10
Phase 5783-387 Cost type 9
Phase 450-123 Cost type 1,2,3,4,5,6,7,8,9,10
Phase 9999 Cost type 6,8,10
I have tried to combine the cost types. The result is just the first cost type.
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 12 Jun 2013 at 4:13am
i assume each cost type is a different row of data.
you would have to group on phase and use shared variables to concantenate your cost types across rows then display the final result in the group footer. You can then suppress the GH and detail sections.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 12 Jun 2013 at 4:43am
typically shared variables come as a group of 3 formulas, reset, increment, and display. Let's start with the easiest and go from there.
reset, typically in the group header:
shared stringvar costs := "";
display, typically in the group footer:
shared stringvar costs;
mid(costs, 3) //strips the leading comma off
increment is usually in the detail section and is the most tricky, since it is where the 'work' is done.
shared stringvar costs;
costs := ", " + {table.field} //you might need to convert this field to a string if it is numeric
if you need to convert, totext({table.field}, 0, "") should do the trick.
again as DBlank mentioned, you can suppress the GH and detail section, as the group footer will be displaying the values that you're after.
Joined: 08 Feb 2013
Online Status: Offline
Posts: 22
Posted: 12 Jun 2013 at 8:10am
I think I may be missing something. The output is just one cost type per phase on a row. I do have a Group Header 1 set to Job and Group Header 2 set to phase. The reset formula is in Group Header 2.
Joined: 08 Feb 2013
Online Status: Offline
Posts: 22
Posted: 12 Jun 2013 at 8:25am
That is exactly how I have the formulas and the report is still one cost type per phase. I have the incremental set up as: shared stringvar costs; costs := ", " + ToText({JCCT.CostType},0,"")
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum