I am new for business object. I want to create a object with group by clause. I want to fetch Min(row_active_date) from a table with group by clause. I used group by in object’s where clause. Parsing is OK. however when i am running this report it is giving me only one value. which is Minimum value of row_active_date. Group by is not working. Can anyone help me on this please. I have attached a screenshot which shows, the way i am doing this.
Group by is something you need to view as ‘in the report’.
Webi will group on the basis of the selected field.
A universe provides information on the select * from … where table.x=table.x
A webi-report will then group further if required on basis of your selected field.
So here if you leave out the group it will take the min(.) over what is selected.
And in displaying in webi for instance it will be min(.) according to the information you show.
If your reeeeeeaaally need the grouping to be done in the universe then in deed use a derived table.
I must add that i prefer anything but sum to be done with variables in a report.
In 4.0 I find contexts in the report easier to use then before for some reason, which then also gives a better insight in where the calculations are done in relation to the data retrieved.
Its not recommended to write the Group By Clause in the Object definition. How ever as mentioned by Andreas you can create a derived table create the Min object for that table.
select
table.column1,
table.column2,
table.column3,
Min(table.ColumnABC)
From Table
Group by
table.column1,
table.column2,
table.column3
Join this derived table to your original table (TABLE) on
column1
column2
It may be a case of always wanting the minimum for that particular combination of objects in the derived table, no matter what set of results you have in the Webi query. A touch limiting, but the only reason that I can think of and arguably better achieved through a database function.