.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Range dimension: how to address this requirement?

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :Sql Server
Hi All,

Let me describe the requirement using 'FactInternetSales' table.

I have a Date_Range dimension with members 7 days, 14 days, 30 days, etc. To associate this dimension I need
DateRangeKey in the FactInternetSales table but FactInternetSales doen't have TimeKey (it has OrderDateKey, DueDateKey, ShipDateKey).
So how I can calculate DateRangeKey in the FactInternetSales named query using OrderDateKey, DueDateKey or ShipDateKey as they relate to their respective dimension but I need DateRangeKey from TimeKey (I guess OrderDateKey - 7, etc would work instead of TimeKey )?

Without Date_Range dimension I can meet some of my reporting requirement using filter or range operator but not all and for
performance I would like to use Date_Range dimension instead of filter or range.

Any help will be greatly appreciated.


View Complete Post

More Related Resource Links

Dimension Range over time

Is there a method for categorizing measures into ranged dimension attributes over time.  Consider the SQL:       SELECT date, sales = SUM(sales), segment = CASE WHEN SUM(sales) BETWEEN 0 AND 99 THEN 0 WHEN SUM(sales) BETWEEN 100 AND 199 THEN 100 ELSE 300 END      FROM tabl1      WHERE date BETWEEN '01/01/1900' AND '12/31/1900'   Date Sales Segment 1/1/1900 100 100 1/2/1900 150 100 1/3/1900 49 0 1/4/1900 175 100 1/5/1900 99 2 … … … Is it possible to apply this logic across a time range?  For example, this is on a daily basis, is it possible to do this on a monthly, yearly basis or for a range like '01/02/1900' - '05/25/1900' at monthly rollup? Month Sales Segment January 999 300 February 1 0 March 500 300 April 199 100 May 99 0 … … … I've done this using keys on the fact table; they aren't dynamic, but aggregate the measures into defined buckets January 1900, February 1900, etc.  My keys on the fact table are at the monthly level.

IP address range check


Hi There,

I having a problem in getting the ip address of the client. I need to check a Ip and if it is within a range then, it should use resource from local intranet otherwise it should use the web content.  I tried all the below methods. These methods return a three different  ip address on the local sharpoint hosted site, development and production server. also when i check the ip using ipconfig, it is different to the returned ip's. any help would be great !! 

string ClientIP = Request.ServerVariables["remote_addr"].ToString();

string ClientIP1 = Request.UserHostAddress;


string ipaddress;

ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

if (ipaddress == "" || ipaddress == null)

ipaddress = Request.ServerVariables["REMOTE_ADDR"];

string strHostName = System.Net.Dns.GetHostName();
string strIp = System.Net.Dns.GetHostAddresses(strHostName).GetValue(1).ToString(); 


Range dimension - possible with Relative Time Periods?

Hi All,

I have a Date_Range dimension with members 7 days, 30 days and 90 days only.
Although all reporting needs could be well address using existing date dimension and
MDX filter or range operator I need a physical Date_Range dimension.

It seems possible to address my requirement (implementing Date_Range dimension) by Handling Relative Time Periods .
The blog post (by Chris) is rather old and I did not find updates on it or recent similar articles.

Please share your thoughts on how best to address this requirement.


Prakash Gautam

IP Address Blocking or Restriction in SQL Server

"is it possible to block connections to SQL Server based on IP address". As far as now there is no official way in SQL Server to block the connections in SQL Server based on IP address. However this can be done from the OS end, we have the following three options available, refer HERE for more.

.RRAS IP Filter

my ip address

IP Tejji answers question like what is my ip address? find my ip addresss? detect my ip address? Best part is it also determines your local ip address as well as mac address. Further if you keen on browser specification and details regarding browser capabilities can also be found. It also help you see your geographic location. Other details that are available are Latitude, Longitude, timezone, country, region & city. In short it is one-stop-shop for very rich details about your IP and related information.

ListViewControl - how to group items by their value, for eg. date range



I have a table containing courses, columns are 

Name - "Yoga Classes"

DateStart - "2/23/2010"

DateEnd - "2/24/2010"

I am using ListView Control to bind it, is there a way to display them and group them by Month? 

for eg.


Piano Class (10th Jan 2010 - 11th Jan 2010)
Guitar Class (10th Jan 2010 - 11th Jan 2010)


Yoga Class (15th Feb 2010 - 16th Feb 2010)

Thanks for help.

Showing filtered Records in Crystal Report as per User Requirement


ReportDocument reportDocument = new ReportDocument();
    ParameterField paramField = new ParameterField();
    ParameterFields paramFields = new ParameterFields();
    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
    protected void Page_Load(object sender, EventArgs e)
        if (!IsPostBack)
            paramField.Name = "@Ext";
            //*Remember to reconstruct the paramDiscreteValue and paramField objects
            paramDiscreteValue.Value = 44854
            CrystalReportViewer1.ParameterFieldInfo = paramFields;

System.DateTime.AddDays: Value to add was out of range.


I'm getting the following error:

[ArgumentOutOfRangeException: Value to add was out of range.
Parameter name: value]
   System.DateTime.Add(Double value, Int32 scale) +7657639
   System.DateTime.AddDays(Double value) +19

The line from which this error originates has the following code:

expires = Now.AddDays(30)

It occurs irregularly and irreproducably. The server date/time is correct and set to GMT. I've heard that it could be some curiosity to do with timezones, but that is speculative.

It seems that we're some time from the year 10,000 yet, so I can't understand why adding thirty days to the current time could cause this! Any ideas? Culture settings perhaps?

SOA Tips: Address Scalability Bottlenecks with Distributed Caching


SOA makes application scalability easier, but getting the best performance out of your SOA means paying close attention to the details. We'll give you some tips for coding your app more effectively and using distributed caching to remove data access bottlenecks.

Iqbal Khan

MSDN Magazine June 2010

Advanced Basics: What's My IP Address?


If you're like me, you regularly do tech-support for family, friends, and neighbors. You can't go to a party without hearing the familiar refrain: "I've just got a quick question. " It's always something-their Internet connections get dropped, they've got a virus, they can't install some piece of hardware, or some file has gone missing.

Ken Getz

MSDN Magazine December 2005

How i find out light and dark color range??



I am showing preview of text in text box.

But if text color is light(Like white) and i want to show that text preview than text is not visible because textbox background color is white.

Can i get the range of dark and light color so i'll change textbox backgroun color accordingly.

Thanks in advance.

How to work around Share point accessibility requirement ?



I am somewhat new to things related to accessibility in SharePoint. I am trying to work on section 508 accessibility requirements for SharePoint site. I have tried to see few articles from the internet and still looking for more information on the subject matter including what to consider fro preparing requirement.  

I am looking to know what is possible and what is not with SharePoint?

How to achieve all the possible accessibilities in SharePoint?

Is it possible to make accessible all site types (Publishing, team sites,.)?

Please help me in understanding everything around SharePoint accessibility and first in preparing the requirement document. I have tried to see AKS site but there were some issues that are not clear for me at this level.

Thank you in advance,


VS workflow or SPD workflow for this requirement


Hi All, 

Following is my requirement.Need some help in finalising the approach.I want to know if this requirement can be achieved using SPD workflow or do i need to go for Visual studio workflow.And any help on steps to do this will be highly appreciated.

 Links to create new form or to show document library,    Document library will show status of open or closed for each document.
 When listing all documents, user can view any form.  The open forms can be edited. 
  Able to attach multiple files at said fields.  (Possible file formats:   word, excel, PDF, jpg, text, ZIP)
 IT Staff can approve and email notification sent to QA staff saying QA process can start
 QA staff can approve and after approval, the form becomes read only.  Email notification sent to IT staff stating QA is complete.
 When QA staff starts QA and find failures, QA Staff has link to fail the form and send it back to IT Staff for corrections with email notification of failure.
 IT staff will need to approve again and email notification sent to QA again to start QA process again.
 Each form should have failure history with what items has failed.
 For each form, I would like to have the ability to add notes like announcements so previous notes cannot be alt

Calculated Columns in a Form Library receive error: Value does not fall within the expected range.


I have a forms library that posts the date the form was created. We would like to create a calculated column that allows us to look at these forms based on the month and year they were created. I had created a calculated column that extracts the month and replaces the number with a text string by using an if statement; "IF(MONTH([Proposal Date])=1,"January","") It goes on to evaluate each month and replace the number with the text string. This formula worked for quite some time, though now when I try to add any calculated columns or edit any existing calculated columns on this form library I receive the following error: Value does not fall within the expected range. Now my existing calculated columns (like the one above) do not work and I can not create new calcualted columns. Any insight would be awesome as this has been plaguing me for a couple of months now.

When create a suvery using type Rating Scale, is it possible to create 5 range text?


When create a suvery using type Rating Scale, is it possible to create 5 range text?

Default range text only show 3 fields

Find Country using IP Address c# ASP.Net


Hi experts,

how to find the names of countries  using the IP address.

This is my ip address

we are using in C# code please help me this one

Thanks an advance

I.P Address to Location ? by Programming (L I N Q) ? ?

Hello Experts .. Kindly Help me in this .... I have to fetch Location (country , state)  of IP by which orders are purchased .... I managed to get the IP Address of the coustmer by My main concern is location .... can i do this by Programming Via LINQ ....Is this necessary to use another database ... As i get the code which is in VB .... kindly Help me by converting this code in C# or LINQ ... or give me new suggestions ...______________________________________________________________________________________________________________________Protected Sub Button1_Click(ByVal sender As Object,_ ByVal e As System.EventArgs) Handles Button1.Click On Error GoTo HandleError Dim strGetIP As String Dim dblGetLongIP As Double Dim dblPrevPosition As Double Dim dblPosition As Double Dim dblNumber As Double strGetIP = orders.CoustomerIP For i = 1 To 4 dblPosition = InStr(dblPrevPosition + 1, strGetIP, ".", 1) --------- As i used online VB to C# converting this for loop is creating problem ... kindly .. If i = 4 Then dblPosition = Len(strGetIP) + 1 End If dblNumber = Int(Mid(strGetIP, dblPrevPosition + 1, dblPosition - dblPrevPosition - 1)) dblPrevPosition = dblPosition dblGetLongIP = ((dblNumber Mod 256) * (256 ^ (4 - i))) + dblGetLongIP Next
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend