obiee display measures even if it is null - obiee

I am making an analysis with obiee 11g.
I have a program code and some measures I make in my analyse. For example:
count of objectives, count of courses,...
I make this by a formula COUNT(DISTINCT objectives) for example.
The problem is that I have no row, when one of those counts are null.
For example I have a program course with 2 objectives and 2 courses, then it will display
Program count of objectives count of courses
1 2 2
But I have a program 2 with 3 objectives and no courses. The row will not be display, but I want the following result:
Program count of objectives count of courses
1 2 2
2 3 0
How can I achieve this?

Analysis properties -> Data -> Include Null Values

Related

Oracle JOIN VS PARTITION BY

I maintain a table in Oracle that contains several hundred thousand lines of code, including a priority column, which indicates for each line its importance according to the needs of the system.
ID
BRAND
COLOR
VALUE
SIZE
PRIORITY
EFFECTIVE_DATE_FROM
EFFECTIVE_DATE_FROM
1
BL
BLUE
58345
12
1
10/07/2022
NULL
2
TK
BLACK
4455
1
1
10/07/2022
NULL
3
TK
RED
16358
88
2
11/01/2022
NULL
4
WRA
RED
98
10
6
18/07/2022
NULL
5
BL
BLUE
20942
18
7
02/06/2022
NULL
At any given moment thousands more rows may enter the table, and it is necessary to SELECT from it the 1000 rows with the highest priority.
Although the naive solution is to SELECT using ORDER BY PRIORITY ASC, we find that the process takes a long time when the table contains a very large amount of rows (say over 2 million records).
The solutions proposed so far are to divide the table into 2 different tables, so that in advance the records with priority 1 will be entered into Table A, and the rest of the records will be entered in Table B, and then we will SELECT using UNION between the two tables.
This way we save the ORDER BY process since Table A always contains priority 1, and it remains to sort only the data in Table B, which is expected to be smaller than the overall large table.
On the other hand, it was also suggested to leave the large table in place, and perform the SELECT using PARTITION BY on the priority column.
I searched the web for differences in speed or efficiency between the two options but did not find one, and I am debating how to do it. So which of the options is preferable if we focus on the efficiency and complexity of time?

How can I use SumProduct Function in SSRS?

I have three columns in a SSRS table which record telephony data
Row 1 is Calls Offered which is a straight count
Row 2 is Calls Answered is as above
Row 3 is a Service Level Percentage of Calls Answered/Calls Offered
This table spans for 9 months and then there is a total column at the end
Row 1 and Row 2 are easy enough because it's just a grand total but for Row 3
I need to do a weighted average for all the percentages across the 9 months
So how can I do a SUMPRODUCT which will give me the weighted average service level over 9 months
In Excel my formula is as follows: =SUMPRODUCT(E10:M10,E$8:M$8)/SUM(E$8:M$8)
So Row 8 is my calls offered and Row 10 being my percentages - how do I replicate this in SSRS?
Thanks
Dan
I've worked out if anyone is interested it was
=(Sum(Fields!Calls_Answered.Value)/Sum(Fields!Calls_Offered.Value)) * Sum(Fields!Calls_Offered.Value)/Sum(Fields!Calls_Offered.Value)
So it has to do the calculation of the service level percentage first then times that against the amount of calls offered and then divide it against the amount of Calls Offered
Thanks
Dan

is there an algorithm to solve current rating with now one?

I have a old rating from the db and a new Rating from the user,
i tried to search for "rating algorithm" but they save the ratings per user. In my case i don't save the previous ratings. My rating bar is up to max of 5
currently my solution is oldR + newR/ 2. does this make sense?
Not really. When you think about it, such a formula would mean that newer votes are weighted much more than old ones. Imagine a sequence of votes like this:
Vote: 1 1 1 1 1 1 1 1 1 1 1 5
Rating: 1 1 1 1 1 1 1 1 1 1 1 3
Clearly the rating should not be 3 in this case, it should still be 1 (or at worst 2), but with your formula it will be.
At the very least you should store the number of votes as well as the average rating, allowing you to calculate newR = ((oldR*votesCast)+newVote)/(votesCast+1). This also requires to store the rating with a higher precision, not just as an integer. (You can round it off when you display it but internally you should keep track of fractions too.)
A slightly better solution is to separately store how many votes have been cast for the 5 different ratings so far, allowing you to calculate different kinds of means (geometric for example).
And obviously the most flexible (but most storage and computation intensive) is to store each individual vote with user id and timestamp, allowing you to use any algorithm you can think of.

Matrix or Cross Tab report with single field for both Column and Row group

I am trying to create a report of Matrix but I am not sure it is possible to achieve a matrix in SSRS or Crystal Report.
Table
Subject Student#
English 10000
English 10001
English 10002
Math 10001
Math 10002
Math 10003
Math 10004
Science 10000
Science 10001
Science 10007
I like to create a matrix report as below. It will show student counts in both subjects.
---------- English Math Science
English -- 3 ---------- 2 ----- 2
Math__ -- 2 ---------- 4 ----- 1
Science --2 ---------- 1 ----- 3
But both Crystal report and SSRS show only numbers in the meeting cells of the same subject. For example, 3 for English 4 for Math 3 for Science. all the rest cells show 0.
I am not sure it is a best way to achieve but I found an answer myself.
In Crystal, I added a view as View1. I added the same view as view2. All links between the two were cleared. It means the two tables are no joined.
A formula was created.
#BothSubjectStudentID
if View1.StudentID = View2.StudentID then
1
else
0
View1.Subject were added to the columns in a Cross Tab .
View2.Subject were added to the rows in the cross tab.
the formula 'BothSubjectStudentID' was added to summarized Fields:. with Sum().
It took a bit time and returned results I am looking for.

Need help to decide a game strategy

I'd like to know what strategy should be used to solve the following problem.
Problem Statement
There are 2 coal mines, each employing a group of miners. Our job is to send food shipments to the mines. Every time a shipment of food arrives at their mine, the miners produce some amount of coal. There are three types of food shipments: meat, fish and bread.
Every time a new shipment arrives to their mine, they will consider the new shipment and the previous two shipments (or fewer if there haven't been that many) and then:
If all shipments are of the same type, they will produce one unit of coal
If there are two different types of food among the shipments, they will produce two units of coal.
If there are three different types of food, they will produce three units of coal.
The types of food shipments and the order in which they will be sent is known beforehand.
Input
You are given the types of food shipments, in the order in which they are to be sent.
Goal
The goal is to maximize the coal output. This is done by determining which shipment should go to which mine. The 2 mines don't necessarily have to receive the same number of shipments (in fact, it is permitted to send all shipments to one mine).
Example
For the shipment order: MBMFFB, the expected output (maximum possible coal output) is 12.
The logic you use is wrong:
M -> Mine 1 = 1 coal unit(s)
B -> Mine 1 = 2 "
M -> Mine 2 = 1 "
F -> Mine 1 = 3 "
F -> Mine 2 = 2 "
B -> Mine 2 = 3 "
Since for the first day, Mine 1 only had 1 type of food.
I can see a simple dynamic programming algorithm, but I'll leave that to you.
A simple hint: for each shipment, you can send it to either mine 1 or 2; after sending it, what matters is just:
The amount of mine that has been mined;
The previous 3 shipments.
So there are at most (3 ^ 3) ^ 2 = 729 shipment configurations, and for each of these an optimal amount of coal. In each step compute these configurations, and in the end you will get the answer.

Resources