numbers grouping in sap_bo - business-objects

I'm having a problem in SAP BO-s that I'm trying to solve for a while now so I'm hoping to find a help here...
So, I have a list of orders and a number of items on each...
... and a final result should be numbers grouping of numbers of items shown as dimension with number of orders shown as measure...
I've tried with various combinations of foreach and in context operators but none of them seems to work. Does anyone have an idea how to do it? Thanks a lot

The simpliest thing would be to use an object containing the number of items for each order as a dimension rather than a measure. Then you could create groups around the number of items. I am assume you cannot do that.
So start off by creating a variable to convert your Number Of Items Dimension to a string (and dimension) like this...
=FormatNumber([Items_no]; "#")
Next create a variable to count your orders...
=Count([Order_no])
Now adding those two variables to a table will give you the following...
In order to lump anything 6 or greater together you could create a variable with a series of nested if statements. In this situation it is much easier to create a group. To do so, right-click on the Number of Items Dimension column in the table just created, choose "Group > Manage Groups...", and create a group that looks something like this...
Sum the Number of Orders column and there you have it...

Related

SSRS - How to create a sum (total) of an expression column?

After plenty of research, it seemd I can't find a well-explained solution to my problem. I'll join some screenshots of my Tablix, group rows, and group columns to help you to understand.
First of all, here's my tablix. It's linked to a SharePoint List.
The expressions are all like this :
=Count(Fields!ID.Value, "NameOfTheGroup")
It counts the number of elements that are filtered by one of the group chosen in the expression, and it works perfectly fine at this point.
Now, here's my groups :
They all contains filters tomanage the count precisely to the need.
What I want to do : In the last row, I want to display the sum of each column that is in a group row. But theses rows aren't datasets fields, they are just only expressions, and I can't find a way to create a proper total of each column. I heard of Running Value but the few solutions I found about it didn't work.
Thanks for the future help.
EDIT: Actually, the problem seems to be much more complex: any rows I create under my group rows are invisible : if I create a new row under the "Classification", outside the "Classification" row group, the expression I insert in the "CDI", "CDD", etc... columns stay blank. I tried with various expression or just values like "Hello World".

How to create a query that is able to sort data into 2 groups?

so I'm very new to Access - just started learning it this week. I have data comprised of a bunch of policy numbers with corresponding ratings and premium values.
What I'm trying to do is create a query table that aggregates this data by rating (=1 or >1), this is the part I can't figure out. In design mode, I have put criteria =1 or >1, but it's not doing anything; when I switch to datasheet view, it just lists all of the ratings instead of two boxes that say =1 and >1. If anyone could give me insight on how to do this, I'd appreciate it!
From what I understand after reading your question, you want a query that shows two columns, one that counts the records with a rating of 1 and one that counts the records with a rating of greater than 1.
The best way to do this is to set up two expression columns, both wrapped in a count as you can see below:
SELECT Count(IIf([Rating]=1,[Rating],Null)) AS [=1], Count(IIf([Rating]>1,[Rating],Null)) AS [>1]
FROM tblSortRating;
If you have any questions or I've misunderstood your question leave a comment and I'll get back to you.

MySQL: Use aggregate result in further calculation

I'm currently working on writing report generators. For one report I need to do a breakdown by a given characteristic (supplier, logging user, language, etc which for each row includes the name of the characteristic I'm interested in, the number of items that match that characterastic, and the percentage of total items this figure represents. The first two aren't a problem, the third is.
For example, to get a breakdown by language I'd be using a query like this.
SELECT lang_id,
COUNT(IF(open=TRUE,1,NULL)) AS lang_total
FROM table
GROUP BY lang_id;
This gives me the number of items per language.
I can get the total number of items in the table and store it in a variable simply enough with a plain count.
SELECT #totalOpen:=COUNT(*) FROM table WHERE open = TRUE;
Now I want to add a third column, which is the figure in lang_total divided by the value in #totalOpen multiplied by 100 (in other words, the percentage of all items that fit the criteria). Something along the lines of the following:
This is the bit I'm having trouble with, as because as far as I can tell you can't use aggregate columns in calculations.
SELECT lang_id,
COUNT(IF(open=true,1,NULL)) AS lang_total
(lang_total/#totalOpen)*100 as lang_percent
FROM table
GROUP BY lang_id;
I'm sure that there must be a way of doing this in MySQL, but I've not been able to track it down. Can anyone help out with this?
I read this question now for the first time. I know that probably it's too late to be useful for you but I would have solved in this way.
select lang_id,
sum(if(open= true,1,0)) as lang_total,
coalesce(sum(if(open= true,1,null)) / #r,0) as percentage
from table,(select #r:=count(*) from table where open = TRUE) as t
group by lang_id;

Create ordering in a MySQL table without using a number (because then it's hard to put something in between)

I have a long list of items (say, a few million items) in a mysql table, let's call it mytable and it has the field mytable.itemid.
The items are given an order, and can be re=ordered by the user by drag and drop. If I add a field called mytable.order and just put numbers in them, it creates problems: what if I want to move an item between 2 other items? Then all the order fields have to be updated? That seems like a nightmare.
Is there a (scalable) way to add order to a table that is different from just giving every item a number, order by that, and do loads of SQL queries everytime the order is changed?
You can either create a trigger or stored procedure to resequence the order values appropriately, or drop all the associated records and insert new ones in the new order.
You can use fractions (two integers, i.e. a/b). Always there is at least one rational between two other.

How to filter a list of items in a MySQL database?

I have list store in mysql table file1=(1,2,3,4,6,7) and other list file2 = (3,2,4,8,9,10,12) is not stored in table, i want compare both and result should be like
result=(6,7,8,9,10,12) then calculate the percentage. like 100*(result/file1+file2) in mysql data structure. i do not know how i will do it.
please know body know guide me or give me a small example.
thanks
Create a temporary table to store the "other" list that is not already in a table, and then use a join or union to get the result you want.
If you are wanting to select the values that are not in either list, then you can use GROUP BY and COUNT to count the occurrence of each number, and then HAVING to select those rows with a count of 1.
I don't think you can easily do that in pure sql. you need a procedural language to get the result in the first list, merge, sort, unique with the second list and compute the result.