Fact column shows null values in report
Hi Experts,
I have a requirement where i need to create report from a Dimension Dim1 and 2 Fact Tables Fact1, Fact2 with the columns as Dim1.State, Fact1.Price, Fact1.Source,Fact2.Market Value. The two fact tables are at different granularity, when i run the report it is issuing the query only from Fact 1 and putting NULL for the column from Fact 2. Can someone guide me on how to approach.
Thanks,
Chandrasekhar
Welcome to the magic world of content level.
You give yourself the answer to your issue: "the two fact tables are at different granularity" (95% of chances you are just on that case for your issue).
Time for some reading: https://greatobi.wordpress.com/2013/09/10/the-single-most-important-thing-to-know-about-the-obi-rpd/
Similar Messages
-
Cross Tab Report...Calculated Column shows NULL
Hi there
I have one calculated field which is based on some calculation when I run my report in Discoverer Desktop I can see the 0 in NULL values in all rows.
But when I run this report in Discoverer Plus/Discoverer Viewer it shows me Null for some values or some values I can see the zeros.
I have checked the WorkBooks options its all set to 0.0.
1)
Edit---> WorkSheet Properties ---CrossTab Format ---Show Null values as 0.0
2)
Tools---> Options---> Sheet--->Show Null values as 0.0
3)
I have settings in Pref.txt which means Some reports I want to see the NULL values...
Pref.txt
NullValue = "NULL"
Do you have any idea..
Thanks
ASIMWell, I don't really have an idea what is happening, but i have a solution to hide nulls.
You can create an exception on the columns.
when column_name = Null then change the forecolor to match with the backcolor.
This will make the text and box of same color and will hide nulls.
Cheers :) -
DBA_USERS showing null values in PASSWORD column
Hi,
We are running a select query from dba_users table as follows :
select username from dba_users
where to_char(expiry_date, 'DD-MON-YY') =
to_char(sysdate + &expire_day, 'DD-MON-YY')
and password not in ('EXTERNAL','account-locked')
and account_status <> 'LOCKED';
This query was running fine with 10g Version, but after Oracle was upgraded to 11G recently, above query does not return any rows.
Also, when we remove the condition "and password not in ('EXTERNAL','account-locked')", it works.
And the values for the PASSWORD column shows null.
Is this related to Oracle upgrade ?
Kindly help..
Thanks,
JatinI have the same behavior in my 11g db (I have nulls in password column too) as checking docs:
[url http://download.oracle.com/docs/cd/E11882_01/server.112/e24448/statviews_5081.htm#REFRN23302]Oracle® Database Reference 11g Release 2 (11.2) - DBA_USERS
I can see:
USER_USERS describes the current user. This view does not display the PASSWORD, PROFILE, PASSWORD_VERSIONS, EDITIONS_ENABLED, or AUTHENTICATION_TYPE columns....
PASSWORD VARCHAR2(30) This column is deprecated in favor of the AUTHENTICATION_TYPE columnIt seems you need to get this info from somewhere else.
Edited by: Kecskemethy on Oct 3, 2011 2:36 AM -
'Show Null Values as' variables not replaced
I need the null values to display as small as possible so there is an image in my image repository, 1x1px, transparent, that I wanted to display in these null places, but when I inserted something like <img src="&COMPANY_IMAGES.null.gif"> or <img src="#COMPANY_IMAGES#null.gif">, the COMPANY_IMAGES was not replaced with the usual long call, it was just like inserted in the 'Show Null Values as' field.
I have workarounds
1) use a static image, that is publicly available - making the app's appearance dependant on that publicly available image.
2) select columns with nvl(NULLABLE_COL, '<img src="#COMPANY_IMAGES#null.gif">'), which is just a thing, that could be easily forgotten in some place and makes the query even more obscure than it already is.
I really like neither of them. Is there some other way to call COMPANY_IMAGES in that field or is it just a place where isn't the substitution string available?wow. you're right about that substitution not being made in that "Show Null Values as" field. i'll log that issue in a sec. you can work around the issue for now by simply doing that substitution yourself. so if you run this...
select :WORKSPACE_IMAGES FROM DUAL
...from your sqlWorkshop, you'll see that WORKSPACE_IMAGES is substituted with a call like...
wwv_flow_file_mgr.get_file?p_security_group_id=123456&p_fname=
...(where 123456 is my :WORKSPACE_ID). if you wanted to call an image called my_image.jpg in that "Show Null Values as" field, you could just enter the string...
wwv_flow_file_mgr.get_file?p_security_group_id=123456&p_fname=my_image.jpg
...right in there, and you'd find your images rendered correctly. the only thing to watch out for is the hard-coded :WORKSPACE_ID in your field. you'd have to mind at number if you deployed your app in a different workspace.
hope this helps,
raj -
How to take the Average of a DATEDIFF column with NULL values?
I am building an SSRS report that can display the average of a calculated datediff column in dd/hh/mm format with the following formula:
=Avg(IIF(Fields!LastCorrectedDate.Value is nothing,0, DATEDIFF("n",cdate(Fields!LastCorrectedDate.Value),cdate(Fields!
LastSignDate.Value)) \(60*24) & ":" & DATEDIFF("n",cdate(Fields!LastCorrectedDate.Value),cdate(Fields!
LastSignDate.Value)) mod (60*24)\60 & ":" & DATEDIFF("n",cdate(Fields!LastCorrectedDate.Value),cdate(Fields!
LastSignDate.Value)) mod (60*24) - (((DATEDIFF("n",cdate(Fields!LastCorrectedDate.Value),cdate(Fields!
LastSignDate.Value)) mod (60*24))\60)*60) ))
SSRS does not raise any errors with the formula and I have used the same formula for other columns without issue. I have noticed that this column includes null values which I think may be the problem. When the reports runs, it returns #ERROR on the column
but does not give a reason why. I am using SSRS report builder with visual basic logic as opposed to embedding SQL. Any help or feedback would be greatly appreciated.Hi No Ragrets,
According to your description, you want to calculate the average for the date time difference. Right?
In Reporting Services, Avg() function is only available for numeric values. In this scenario, the DateDiff() function to calculate the minutes difference will return a number. So we can do average calculation based on the return values first. Then we format
it as a time. We have tested this case in our local environment. Please try the following expression:
=floor(avg(DateDiff("n",Fields!StartDate.Value,Fields!EndDate.Value))) \(24*60) &":"&
floor(avg(DateDiff("n",Fields!StartDate.Value,Fields!EndDate.Value))/60 mod 24 )&":"&
floor(avg(DateDiff("n",Fields!StartDate.Value,Fields!EndDate.Value))) mod 60
The result looks like below:
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Sql query slowness due to rank and columns with null values:
Sql query slowness due to rank and columns with null values:
I have the following table in database with around 10 millions records:
Declaration:
create table PropertyOwners (
[Key] int not null primary key,
PropertyKey int not null,
BoughtDate DateTime,
OwnerKey int null,
GroupKey int null
go
[Key] is primary key and combination of PropertyKey, BoughtDate, OwnerKey and GroupKey is unique.
With the following index:
CREATE NONCLUSTERED INDEX [IX_PropertyOwners] ON [dbo].[PropertyOwners]
[PropertyKey] ASC,
[BoughtDate] DESC,
[OwnerKey] DESC,
[GroupKey] DESC
go
Description of the case:
For single BoughtDate one property can belong to multiple owners or single group, for single record there can either be OwnerKey or GroupKey but not both so one of them will be null for each record. I am trying to retrieve the data from the table using
following query for the OwnerKey. If there are same property rows for owners and group at the same time than the rows having OwnerKey with be preferred, that is why I am using "OwnerKey desc" in Rank function.
declare @ownerKey int = 40000
select PropertyKey, BoughtDate, OwnerKey, GroupKey
from (
select PropertyKey, BoughtDate, OwnerKey, GroupKey,
RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]
from PropertyOwners
) as result
where result.[Rank]=1 and result.[OwnerKey]=@ownerKey
It is taking 2-3 seconds to get the records which is too slow, similar time it is taking as I try to get the records using the GroupKey. But when I tried to get the records for the PropertyKey with the same query, it is executing in 10 milliseconds.
May be the slowness is due to as OwnerKey/GroupKey in the table can be null and sql server in unable to index it. I have also tried to use the Indexed view to pre ranked them but I can't use it in my query as Rank function is not supported in indexed
view.
Please note this table is updated once a day and using Sql Server 2008 R2. Any help will be greatly appreciated.create table #result (PropertyKey int not null, BoughtDate datetime, OwnerKey int null, GroupKey int null, [Rank] int not null)Create index idx ON #result(OwnerKey ,rnk)
insert into #result(PropertyKey, BoughtDate, OwnerKey, GroupKey, [Rank])
select PropertyKey, BoughtDate, OwnerKey, GroupKey,
RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]
from PropertyOwners
go
declare @ownerKey int = 1
select PropertyKey, BoughtDate, OwnerKey, GroupKey
from #result as result
where result.[Rank]=1
and result.[OwnerKey]=@ownerKey
go
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Show NULL values in an SQL query
Hi,
Please excuse my ignorance, but I am very green in Oracle.
I am trying to create a simple function in PHP to return a list of the entire table row in an Oracle DB, however no matter I do Oracle skipps the columns with NULL values, which means that I don't even get the number of the columns corect. The query is as simple as it can get:
SELECT * FROM table_name;
I've tried NVL, DECODE and god knows what else. Please give me a hand with this.
Cheers,
PimmyOnce you can use ODBC it should be possible to use MySQL with HS:
http://www.idevelopment.info/data/Oracle/DBA_tips/Heterogeneous_Services/HETERO_2.shtml
What concerns the licenses: We are not referring to transparent gateways but to heterogenous services (generic connectivity) which come free with the DB:
http://www.oracle.com/technology/products/gateways/faq.html#A707 -
Hi,
I am running Discoverer Plus 10.1.2.45.46c. We are running into some issues with the Show Null values as option under Tools/Options/Sheet tab. If you open an existing workbook that has this value set to NULL you can't change your output to show as ' ' for example.
Has anybody else ran into this ? Is there a work around ?
Thanks
DennisAs per bug 4330751 - workbooks created in desktop with the option for nulls set to "" will display as NULL in plus. There is a new worksheet setting for nulls that you can modify in plus - Edit->Worksheet Properties->Crosstab/Table Format tab.
The pref.txt setting will be honored for new plus workbooks. -
To overcome column with null value-urgent
hai all,
when i query i get column with null value.
how to solve it?
thank in advance.
rcs
SQL> DESC SCOTT.CB1;
Name Null? Type
ID NUMBER
SUPCODE NUMBER
SUPLNAME VARCHAR2(100)
NAME VARCHAR2(100)
ITEMCODE VARCHAR2(10)
RECDOC NUMBER
RECDATE VARCHAR2(10)
TOTVALUE NUMBER
QTY NUMBER
CB_IPNO NUMBER
CB_VNNO NUMBER
CB_VDT VARCHAR2(10)
CB_AMT NUMBER
RECDOC_GR VARCHAR2(30)
RECDATE_GR DATE
SUPCODE_GR VARCHAR2(10)
TABLE LOOK LIKE THIS (NOT ALL DATA IN SAME ROW, BECUSE I INSERTED LAST 3 COLUMN VALUES):
ID SUPCODE SUPLNAME NAME ITEMCODE RECDOC RECDATE TOTVALUE QTY CB_IPNO CB_VNNO CB_VDT CB_AMT RECDOC_GR RECDATE_GR SUPCODE_GR
2015 AAAA 04117 9083 10545.6 78
2016 BBBB 04609 9087 25200 3600
2017 GGGG 04609 9088 28175 4025
2018 36591371.64 2565017.27
00001/07-08 02/04/2007 14020362
00002/07-08 02/04/2007 14020362
00003/07-08 02/04/2007 14010254
00004/07-08 02/04/2007 14010254
00005/07-08 02/04/2007 14021458
SQL> SELECT DISTINCT ID, SUPCODE_GR, NAME, ITEMCODE, RECDOC, RECDATE_GR, TOTVALUE, QTY FROM SCOTT.CB
1;
ID SUPCODE_GR
NAME
ITEMCODE RECDOC RECDATE_G TOTVALUE QTY
1
PRO.AT.ALU.POWDER UNCOATED
04609 15 51975 7425
2
PEN, GEL PEN
07969 17 154 11
ID SUPCODE_GR
I NEED RESULT AS FOLLOWS (ALL RESPECTIVE DDATA IN ONE LINE NOW NOT LIKE THAT):
ID SUPCODE SUPLNAME NAME ITEMCODE RECDOC RECDATE TOTVALUE QTY CB_IPNO CB_VNNO CB_VDT CB_AMT RECDOC_GR RECDATE_GR SUPCODE_GR
2015 AAAA 04117 9083 10545.6 78 00001/07-08 02/04/2007 14020362
============Even accounting for the formatting, I'm not sure I even understand the question. It could be any number of different problems or non-problems.
-
How to validate if a column have NULL value, dont show a row with MDX
Hello,
I have this situation, I have a Result from MDX that return rows with values NULL on columns, I tried with NON EMPTY and NONEMPTY but the result is the same. That I want to do is validate if a column have a Null value discard the row, but I dont know how
to implement it, could somebody help me?, please.
Thanks a lot.
Sukey Nakasima
Sukey NakasimaHello,
I found the answer in this link https://social.technet.microsoft.com/Forums/sqlserver/en-US/f9c02ce3-96b2-4cd6-921f-3679eb22d790/dont-want-to-cross-join-with-null-values-in-mdx?forum=sqlanalysisservices
Thanks a lot.
Sukey Nakasima
Sukey Nakasima -
Limit SC showing Zero value in report SC per cost centre in SRM portal
Hi SRM Gurus,
On executing SC per cost centre report avaialble in SRM 5.0 Portal I am getting value of limit SC as zero. while in all other follow on documents i.e. PO and Invoice its displaying the value.
Is it due to the fact the for Limit Items we don't have any GR/confirmation i.e zero quantity? and the value column field has Sigma symbol on it. so maybe it is multiplying quantity with the value here?
Is this SAP SRM standard for limit items to show zero value in this report ?
Please let me know. Thanks for the help.
Regards,
Varun Dhawan.SRM experts please help in this regard. Any insights on LIMIT Shopping carts??
-
Showing Null values in Cross-tabs
Post Author: merv
CA Forum: Charts and Graphs
I've created a cross-tab report but I will like for the report to list the rows will null values as well as the rows with values. I need to do this because I cannot create one cross-tab with all of the necessary fields, so Iu2019ve created 3 cross-tabs and placed them side by side. Or is it possible to link the cross-tabs. Thanks
I would like to see the following
Total
A
A-
A+
B
B-
B+
C
C-
C+
D
Total-1
Total-2
Canada
MATH30800
24
12
0
0
4
0
4
0
0
0
0
Canada
MATH30800
24
Canada
MATH30800
0
Nigeria
MATH201
12
8
2
2
0
0
0
0
0
0
0
Nigeria
MATH201
0
Nigeria
MATH201
12
Poland
CHEM31800
8
0
1
0
0
0
3
1
0
0
0
Poland
CHEM31800
8
Poland
CHEM31800
8
Puerto Rico
MATH190
0
0
0
0
0
0
0
0
0
0
0
Puerto Rico
MATH190
1
Puerto Rico
MATH190
0
Panama
ENGR10300
39
3
4
1
2
4
6
3
3
0
1
Panama
ENGR10300
0
Panama
ENGR10300
39
Romania
MATH31601
4
2
1
0
0
0
0
0
0
0
0
Romania
MATH31601
4
Romania
MATH31601
0
Afghanistan
EAS10600
11
0
4
0
0
1
1
1
0
0
0
Afghanistan
EAS10600
0
Afghanistan
EAS10600
11
Bahamas
HS-COURSE
0
0
0
0
0
0
0
0
0
0
0
Bahamas
HS-COURSE
27
Bahamas
HS-COURSE
0
Brazil
HS-COURSE_2
1
0
0
0
0
0
1
0
0
0
0
Brazil
HS-COURSE_2
0
Brazil
HS-COURSE_2
1
instead of what's bellow
Total
A
A-
A+
B
B-
B+
C
C-
C+
D
Total-1
Total-2
Canada
MATH30800
24
12
0
0
4
0
4
0
0
0
0
Canada
MATH30800
24
Nigeria
MATH201
12
Nigeria
MATH201
12
8
2
2
0
0
0
0
0
0
0
Poland
CHEM31800
8
Poland
CHEM31800
8
Poland
CHEM31800
8
0
1
0
0
0
3
1
0
0
0
Puerto Rico
MATH190
1
Panama
ENGR10300
39
Panama
ENGR10300
39
3
4
1
2
4
6
3
3
0
1
Panama
ENGR10300
0
Afghanistan
EAS10600
11
Romania
MATH31601
4
2
1
0
0
0
0
0
0
0
0
Romania
MATH31601
4
Brazil
HS-COURSE_2
1
Afghanistan
EAS10600
11
0
4
0
0
1
1
1
0
0
0
Bahamas
HS-COURSE
27
Brazil
HS-COURSE_2
1
0
0
0
0
0
1
0
0
0
0Post Author: azanobrown
CA Forum: Charts and Graphs
What I've done in the past is create a new formula for your "value" field similar to this and put it in your cross-tab:if {original value field} is "" then [0] else {original value field}the purpose is to create a record value (e.g. 0) where there is no record. I hope that this helps. -
Implicit Fact column creating problem to the reports.
Hi Friends,
I have two reports from same subject area from two different facts F1 & F2.
I have created one implicit column, as it is unable to judge from which fact it needs to build the query. So, it is genarting query from fact F1.
I have created one logical column in the fact and marked it as Implict column in presnenation layer.( as we the process)
But the problem is, for both the reports it is using same implicit column and it is generating the query with only one fact F1.
It is excluding the other fact F2.
One report it shoud use Fact1 and other report it should use Fact2.
PLease hep me in regarding this,
Thanks & Regards,
Kalyan J VKallu wrote:
Hi Friends,
I have two reports from same subject area from two different facts F1 & F2.
I have created one implicit column, as it is unable to judge from which fact it needs to build the query. So, it is genarting query from fact F1.
I have created one logical column in the fact and marked it as Implict column in presnenation layer.( as we the process)
But the problem is, for both the reports it is using same implicit column and it is generating the query with only one fact F1.
It is excluding the other fact F2.
One report it shoud use Fact1 and other report it should use Fact2.
PLease hep me in regarding this,
Thanks & Regards,
Kalyan J VFrom my understanding, implicit fact column's are set a subject area level and not dimension/fact level. So the fact table you have set for implicit fact will be used in both the reports. Why dont you just drag the second fact into the report and hide it, if you are not trying to use the fact 1 that is setup as implicit fact? -
ORA-01405 in Pro*C Although no Column has NULL Value
I have a Pro*C program that fetch a cursor from Oracle 8.1.5 into host variables without indicators. I have tried the SQL statement and the SQL will never return any NULL value in any column, however I still got the ORA-01405 error. Any one has any clue?
Use Indicator variables and let me know if it solves your problem.
http://docs.jcu.edu.au/oracle/doc/server.804/a58233/dev.htm#2239 -
Problem when passing string array in sessions showing null value
i am trying to pass a string array but it is showing me the null value
i think the the problem is seem to be in session.settAttribute("subject['"+i+"']",subject) in 2.login_action.jsp
or in String sub1=(String) session.getAttribute("subject[0]"); in 3.user_home.jsp
i have following three pages
1.login.html
2.login_action.jsp
3.user_home.html
1.login.html
<html>
<body>
<form method="post" action="login_action.jsp">
Username<input type="text" name="username"></input>
<br>
Password<input type="password" name="password"></input>
<input type="submit" value="login"></input>
</form>
</body>
</html>
2.login_action.jsp
<%@ page contentType="text/html"%>
<%@ page import="java.sql.*" %>
<%!
String user,pwd;
String subject[]=new String[10];
int i,totalsubject;
%>
<%
try
user=request.getParameter("username");
pwd=request.getParameter("password");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:ods","scott","tiger");
PreparedStatement ps = con.prepareStatement("select password from users where username='"+user+"'");
ResultSet rs = ps.executeQuery();
if(rs.next())
if(rs.getString("password").equals(pwd))
session.setAttribute("username",user);
PreparedStatement ps2 = con.prepareStatement("select subject_id from allot_teachers where staff_id='"+user+"'");
ResultSet rs2 = ps2.executeQuery();
while(rs2.next())
i=0;
subject[i]=rs2.getString(1);
// if i display here the subjects in out.println(subject[i]) it is working fine
// but in next redirected page it is showing null
session.setAttribute("subject['"+i+"']",subject[i]);
//out.println(subject[i]);
i++;
response.sendRedirect("user_home.jsp");
else
out.println("error invalid username or password");
else
out.println("error invalid username or password");
con.close();
catch(Exception e)
out.println(e);
%>
3. user_home.jsp
<%@ page contentType="text/html"%>
<%@ page import="java.sql.*" %>
<html>
<%
String user,pwd,cat,cat1;
String username=(String) session.getAttribute("username");
if(username==null)
response.sendRedirect("login.html");
//just tried for first two subjects
String sub1=(String) session.getAttribute("subject[0]");
String sub2=(String) session.getAttribute("subject[1]");
//here it is printing null
out.println(sub1);
//here it is printing null
out.println(sub2);
%>
<form method="post" action="logout.jsp">
<input type="submit" value="Logout"></input>
</form>
</html>
Cheers & Regards
sweetyThe name in getAttributre doesnt match the name in setAttribute.
Note "subject[0]" is a string containing 10 chars, "subject" is a string containing 7 chars.
Here is your code:
session.setAttribute("subject",subject);
String sub1=(String) session.getAttribute("subject[0]");
Maybe you are looking for
-
Exporting Crystal Report data to the Excel Print Headers
Hello everyone. I am trying to do something with Excel headers that is a little more advanced than the usual. I have multiple reports that are designed to export to Excel. Normally I only export a report header. However, I have a customer who wan
-
Dreamweaver will not upload file to Server
I am having an issue uploading files to the server with Dreamweaver. I have been using Creative Cloud for 6 months and the issue started Monday. If I select a file, click put icon the FTP access connects to the server successfully. However, the FTP l
-
Files locked when viewed on Mac, not locked on PC.
I'm creating files on a PC that are not locked, yet when I view them through the network, SOME of them are labeled as "locked" in Get Info and I have to go through the minor task of holding down OPTION when emptying the trash if I use the Mac to dele
-
Attribute Importance - Measure Influence of single classes
Hello, I've been solving an Attribute Importance problem recently and identified the most influential factors. Now i want to find out which particular classes of this attribute have the strongest relation to the target. If you take the affinity card
-
The image of my macbook is wider than the screen
Hi, my wife was using our macbook this morning, and when she turned up, the image of the system has a wider range than the size of the screen. I tried verifying the resolution of the lcd, but everything is ok. I restarted the notebook, and noticed th