Page 1 of 2

Grouping From String

Posted: Tue Feb 12, 2013 12:21 am
by tims
I have a report that I need to create to take a variety of string values and turn them into a data source, then group like items within that datasource.

I've attached the sample data and the report as far as I've gotten it.
The original data comes from a string value with a ; delimiter that comes from a variety of lines in a datasource. I take all the string values and concatenate them together, then use a Substring formula to pull them out into individual lines. In the attached example, there are about 50 lines in the original datasource, each with a Quantity that defines how many subfields there will be in the string value on each line (Hardware.Comments), to a total of 202 individual subfields all together.
I have a couple of issues.
The first is how to set the count value for the second set of detail records so that it is equal to the total of the quantity from the first databand (Sum(Hardware.QTY))
The second is how to take all these subfields from the string broken out into individual records with the final data band and group them by like values and sum the Hardware.QTY for each like value.
The end result of this report should be a short list showing
223 - QTY ###
224 - QTY ##
etc.

https://dl.dropbox.com/u/99199395/310185-02.zip

Thanks for any help you can provide.

Re: Grouping From String

Posted: Tue Feb 12, 2013 1:11 pm
by Alex K.
Hello,

Can you please show a sample image or screenshot how it should look like with sent data.

Thank you.

Re: Grouping From String

Posted: Thu Feb 14, 2013 9:55 pm
by tims
Please find the image of the desired result here.

https://dl.dropbox.com/u/99199395/Key_Report_Result.png

Thanks.

Re: Grouping From String

Posted: Fri Feb 15, 2013 1:31 pm
by Alex K.
Hello,

Most probably, but the once solution will be spliting this column for each value (without delimeters) and use grouping in query.

Thank you.

Re: Grouping From String

Posted: Wed Feb 20, 2013 12:44 pm
by tims
Can you explain what you mean? I don't understand.

Re: Grouping From String

Posted: Wed Feb 20, 2013 1:10 pm
by Alex K.
Hello,

For example:
now :
ID | Key | Value ...
1 | 212;213; 214 | 1
2 | 212;217 | 1
3 | 213 | 1
...
the once solution will be spliting this column for each value (without delimeters)
ID | Key | Value ...
1 | 212 | 1
1 | 213 | 1
1 | 214 | 1
2 | 212 | 1
2 | 217 | 1
3 | 213 | 1
...

And use the query with grouping:
select ID, Key, Sum(Value) as QTY from Table
group by ID, Key

Thank you.

Re: Grouping From String

Posted: Wed Feb 20, 2013 3:22 pm
by tims
So unless I'm understanding, I think i have the splitting part working, on pages 2-8 of the current report, I just don't know how to get the grouping working.

Re: Grouping From String

Posted: Thu Feb 21, 2013 11:56 am
by Alex K.
Hello,

Please check the modified report in attachment.

Thank you.

Re: Grouping From String

Posted: Thu Feb 21, 2013 10:10 pm
by tims
Thanks. That looks great, but there appears to be an issue. I created the summary in the image in excel from the report export, so I beleive the QTY's are correct in the image. When I add up your numbers, I only get a total of 184. The total should be 202.
Also, would it be possible to sort ascending by key number?

Thanks,
Tim S.

Re: Grouping From String

Posted: Fri Feb 22, 2013 7:32 am
by Alex K.
Hello,

Sorry, error in indexes. Please check the report in attachment.

Thank you.