Page 1 of 2

How to Merging Group by Condition?

Posted: Wed Feb 05, 2014 4:48 pm
by l.rohrmann
Hi,
I've got plenty of articles with multiple atributes:

Code: Select all

Article    - ID
           - Name
           - Price
           - Quantity
           - TaxRate
which I'd like to group and process duplicates.
To start with, take this example:

Code: Select all

|| Article | Price | Quantity | Total | TaxRate ||
|| Art1    | 100   | 5        | 525   | 5       ||
|| Art2    | 20    | 7        | 154   | 10      ||
|| Art3    | 15    | 4        | 49,5  | 10      ||
What I need is Merging all the same TaxRates while summing the related Total Price and the paid Tax

Code: Select all

|| TaxRate | Price | Tax  ||
|| 5       | 525   | 50   ||
|| 10      | 203,5 | 19,5 ||
When using this...:

Code: Select all

[Group Header; Condition: {Article.TaxRate}]
[Data Band; Bussines Object: Article]
  DataBand Column1 [{Article.TaxRate}](<= Process Duplicates - Hide) 
  DataBand Column2 [{Sum(Article.Price*Article.Quantity*(1+(Article.TaxRate/100)))}](<=Process Duplicates - Hide by Tag) 
  DataBand Column3 [{Sum(Article.Price*Article.Quantity*Article.TaxRate/100)}](<=Process Duplicates - Hide by Tag)
[Group Footer]
...instead I get this:

Code: Select all

|| TaxRate | Price | Tax ||
|| 5       | 525   | 50  ||
|| 10      ||
||         ||
This description is a simplicified Version of the attached example.mrt, but its meant to do the same.

Also I guess, I need to set the "Tag" when using "Hide by Tag", but I can't find how to do this. Might it be, this Option is called different in the program-description, because of language differences?

Re: How to Merging Group by Condition?

Posted: Thu Feb 06, 2014 12:31 pm
by HighAley
Hello.

It seems that it's something wrong with your calculation or we don't understand something. But in the Art1 line if the TaxRate is 5 the Total price should be 525. So our calculations deviate from yours.
Please, look at the attached report template how it's possible to group your data.
report.zip
(2.22 KiB) Downloaded 301 times
Thank you.

Re: How to Merging Group by Condition?

Posted: Thu Feb 06, 2014 1:24 pm
by l.rohrmann
To start with: you are right, it should be 525 (which got changed now), but otherwise this was an handwritten example wich has nothing to do (except the structure) with the example.mrt.
Second, thanks for showing, how to use the Groupe Header, before I only saw a Placement inside the DataBand betwen GroupHeader and GroupFooter.

Now, after placing my fields inside the GroupHeader it loks like this:

Code: Select all

|| TaxRate | Price | Tax ||
|| 5       | 525   | 25  ||    ( <= This works fine so far, because its only a Sum of one Position/Article)
|| 10      | 154   | 14  ||    ( <= Now it only contains the Sum of Art2/ How do I get the Sum of Art2 and Art3?)
So, how do I achive to get the Sum of Art2 and Art3?

Re: How to Merging Group by Condition?

Posted: Fri Feb 07, 2014 5:15 am
by HighAley
Hello.

Please, check our sample report and use the right Sum function.

Thank you.

Re: How to Merging Group by Condition?

Posted: Fri Feb 07, 2014 9:00 am
by l.rohrmann
I'm pretty sure, this is like the example code.
But take a look for yourselfe.

I replaced the DataBand between Header and Footer with a DataTable which is used in the Sum-Function. Still I can't see, what this should be good for (because it has no effect).
Also it still does not work as expected, as Long as there is more then one different Position(which in my case is the Article) per TaxRate-Value. This is not what i need, also it is nothing, which has anything to do with a 'Sum' in my opinion, so what am I doing wrong?

Code: Select all

Still from:
|| TaxRate | Price | Quantity | Total | Tax  ||
|| 5       | 20    | 10       | 200   | 10   ||
|| 5       | 20    | 5        | 100   | 5    ||
|| 10      | 35    | 2        | 70    | 7    ||

To:
|| TaxRate | Total | Tax  ||
|| 5       | 200   | 10   ||
|| 10      | 70    | 7    ||

But Should be:
|| TaxRate | Total | Tax  ||
|| 5       | 300   | 15   ||
|| 10      | 70    | 7    ||
Regards.

Re: How to Merging Group by Condition?

Posted: Fri Feb 07, 2014 2:04 pm
by HighAley
Hello.

Please, send us a sample project with your business objects to reproduce your issue.

Thank you.

Re: How to Merging Group by Condition?

Posted: Fri Feb 07, 2014 2:59 pm
by l.rohrmann
The example.mrt from my last post is a direct copy of the issue I get, except a bunch of unrelated stuff.
Sadly I can't send you our Business objects because of legal issues, but the structure its quiet simple:

Code: Select all

BusinesObjects => SA => Positions => Amount [.E]
                                  => UnitPrice [.E]
                                  => TaxRate [.E]
To reproduce my issue you only need to use this structure with at least three different Positions, while two Positions need to have the same TaxRate.
Example:

Code: Select all

Positions[0] => Amount = 10
             => UnitPrice = 20
             => TaxRate = 5


Positions[1] => Amount = 5
             => UnitPrice = 20
             => TaxRate = 5


Positions[2] => Amount = 2
             => UnitPrice = 35
             => TaxRate = 10
Hope this Information makes enought sense to locate the Problem.

Re: How to Merging Group by Condition?

Posted: Mon Feb 10, 2014 5:42 am
by HighAley
Hello.

It's not enough. Could you send us a sample project and we don't need you data, but we need to reproduce your issue.
We need to see how do you register data and how do you create objects. So we need to see the working project.

Thank you.

Re: How to Merging Group by Condition?

Posted: Mon Feb 10, 2014 11:18 am
by l.rohrmann
The example.mrt is the original Report-Template, I only deleted all the stuff, wich has nothing to do, with my question. But here is my dictionary (I had to zip it, because this Forum does not accept .dct as file-extention), maby this helps. If there is something else I missed to send over, please tell me.

Re: How to Merging Group by Condition?

Posted: Tue Feb 11, 2014 6:09 am
by HighAley
Hello.

It's not enough. Could you send us a sample project and we don't need you data, but we need to reproduce your issue.
We need to see how do you create and register the business objects. So we need to see the working project.

Thank you.