How does RCOUNT(1) works in OBIEE? - obiee

How does RCOUNT(1) works in OBIEE? I thought it was similar to ROWNUM of SQL. But in my report, more than one row, got the same serial number. This serial number got RCOUNT(1) in it's column formula.
Thanks in advance.

You do an rcount on an expression just like the formula editor tells you.
Geo RCOUNT(Geo)
North 1
East 2
South 3
West 4

Related

Find a value in a column from an array

Hoping someone can help, not even sure how to phrase the question! We have started something of a Harry Potter challenge system at our school. We've divided the pupils into houses and will be awarding points just like in the books. I have managed to dynamically rank the pupils when points are awarded but I need a dynamic overall tally/ranking for each house. So I need a formula that will search the pupil list, find out which house they're in and then add their points to each house total.
I'm something of an enthusiastic amateur when it comes to Excel but this has stumped me.
If you put them into a table with their name, house, and points, you could have a "house rank" by this formula:
=SUM( ($B$2:$B$27=B2)*($C$2:$C$27>C2) ) + 1
putting the formula in this example in E2 (enter it with CTRL+SHIFT+ENTER if you have an older version of Excel) and then copying it down for each pupil.

OBIEE: Finding frequency in pivot table

I have a pivot table that looks like this:
My hope is to make the columns of the anomalies (A,B,C,D,M) that is the frequency of the anomaly. So that the column is basically
Anomaly/# of Inspections
How can I change the format of these cells to show this frequency so that they can be then plotted over time?
From your question, and a little help from the comments on it, it seems you want to display the volume of anomalies as a percentage of the number of inspections. For example in week 11 you had one Anomaly C, which would be 20% of the 5 inspections.
To display 20% instead of 1, the only way to do this is to change the column formula in the criteria to pretty much what you wrote in your question.
100*(Anomaly/# of Inspections)
You can't do this through formatting – you can't format a number into different number, you have to change the calculation to do that.

Slowly Changing Dimensions - exact SQL query implementation to retrieve correct data

I'm a bit new to BI development/ data warehousing, but am facing the old Slowly Changing Dimensions dilemma. I've read a lot about the types and theory, but have found little in terms of, what I view, would be the most common SELECT queries against these implementations.
I'll keep my example simple. Say you have four sales reasons, East, West, North, and South. You have a group of salespeople that make daily sales and (maybe once a year) get reassigned a new region.
So you'll have raw data like the following:
name; sales; revenue; date
John Smith; 10; 5400; 2015-02-17
You have data like this every day.
You may also have a dimensional table like the following, initially:
name; region
John Smith; East
Nancy Ray; West
Claire Faust; North
So the sales director wants to know the monthly sales revenue for the East region for May 2015. You would execute a query:
SELECT region, month(date), sum(revenue)
from Fact_Table inner join Dim_Table on name = name
where region = East and date between ....
[group by region, month(date)]
You get the idea. Let's ignore that I'm using natural keys instead of surrogate integer keys; I'd clearly use surrogate keys.
Now, obviously, sales people may move regions mid year. Or mid month. So you have to create a SCD type in order to run this query. To me personally, Type 2 makes the most sense. So say you implement that. Say John Smith changed from East region to West region on May 15, 2015. You implement the following table:
name; region; start_date; end_date
John Smith; East; 2015-01-01; 2015-05-15
John Smith; West; 2015-5-15; 9999-12-31
Now the sales director asks the same question. What is the total sales revenue for the East for May 2015? Or moreover, show me the totals by region by month for the whole year. How would you structure the query?
SELECT region, month(date), sum(reveneue)
from Fact_Table inner join Dim_Table
on name = name
and date between start_date and end_date
group by region, month(date)
Would that give the correct results? I guess it might --- my question may be more along the lines of --- okay now assume you have 1 million records in the Fact table ... would this inner join be grossly inefficient, or is there a faster way to achieve this result?
Would it make more sense to write the SCD (like region) directly into a 'denormalized' Fact table --- and when the dimension changes, perhaps update a week or two's worth of Fact record' regions retroactively?
Your concept is correct if your business requirement has a hierarchy of Region->Seller, as shown in your example.
The performance of your current query may be challenging, but it will be improved by the use of appropriate dimension keys and attributes.
Use a date dimension hierarchy that includes date->Month, and you'll be able to avoid the range query.
Use integer, surrogate, keys in both dimensions and your indexing performance will improve.
One million rows is tiny, you won't have performance problems on any competent DBMS :)

my widget math formula doesn't calculate correctly

I have a question which may not be your area of expertise but I was trying to help out a friend on their site by making a numerology calculator that would calculate someones birthday, or life path number. Birthday january 13, 1970. Lifepath is 1+(1+3)+(1+9+7+0)=13 1+3=4 so 4 is the number i'm looking for. This is the formula I used Mod(Mod(n,45),9), n=[//math:${input1}//]. And that works on every birthday except one that is supposed to end in 9 in which case it says the lifepath number is 0. Any ideas? One of our users bday is May 1, 1965 which is a 9 and it returns 0 as do all the combos i tried that equal 9. And here it is on the site.http://www.kryschendo.com/numerology_reports.html
First of all, if I'm understanding your example, it should be:
1+(1+3)+(1+9+7+0)=22
2+2=4
Try this:
Mod((n-1),9) + 1, n=[//math:${input1}//]

How to count how many times a rule appears in a specific month.Exce;

I want to count how many times in a specific month(for example:January) the red cell with the rule: equal or more than 15 days -> red cell , appears. How can I do that?
My table looks like this
A B
16.02.2013 15
17.01.2012 20
01.02.2013 4
26.04.2012 10
01.01.2012 21
20.04.2012 7
The answer for January is 2
How can I do if I want to make the count by month and year?
Thank you in advance!
Lygia
You can use the countifs function for this. (Link)
Assuming C1 holds start date you want to count from, and C2 holds end date you want to count too.
=COUNTIFS(A:A;">="&C1;A:A;"<="&C2;B:B;">15")
Not sure if you can tie the condition directly to the formating rule.
I'm guessing that entries in ColumnB greater than or equal to 15 have been formatted red. (Which could imply a flaw in #Taemyr's answer, where >15 should perhaps be >=15.) Also, that the likes of "(for example:January)" implies that a solution that works conveniently for many months would be appreciated, so suggest a PivotTable.
Due to PT constraints, identification of values greater than a cutoff is easier in the source data. In this case should only require filtering to select values that have already been formatted red, and adding a flag, say x, to these.
Then the PT could be filtered for x only and the ColumnA values (ROWS) Grouped by Years and Months. The sum of VALUES field being Count of B.

Resources