Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Analysis Services (2000)
 Null Values

Author  Topic 

muntu
Starting Member

11 Posts

Posted - 2004-07-08 : 05:02:58
Hi all

I have a dimension of Branch with the levels Country,Division,Region and Branch,dimension Item with levels department,category,and Item I also have measure consisting of Sales,receipts,orders.

When you have selected a dimension of branch, demension of item and measure of Sales and receipts sometimes you have a situation where sales are null by there is value for receipts for that particular Item.

There problem comes in when you have to sort according in descending order of the sales the null value comes first. I want the null to be the last.

When you make the null value a zero you run into problems becuase you do not know whether there were zero sales for that item or that item was never ranged for that branch.

Is there a way of making the null to be the last of the sort wothout making it a zero

muntu
Starting Member

11 Posts

Posted - 2004-07-09 : 10:19:58


I must apologise for not being specific with the question. The problem happens when you have exported the results to Excel and wanting to sort them in excel.

Anyway you can use ISNULL and must convert the numeric field that you are going to sort to a character.

eg :
select top 50 branchcode,itemcode ,
isnull(convert(varchar(19),valuesold),'') ,Quantitysold,StockQuantity,StockValue
From Datamarts.dbo.StockandSales_latest
Where ItemCode = 1802609




Go to Top of Page
   

- Advertisement -