Showing posts with label dim. Show all posts
Showing posts with label dim. Show all posts

Thursday, March 8, 2012

Another GUID problem... What is wrong with this code ?

Hi,
I have the following code:
Dim RowLoopIndex As Integer
DsFuncties.Clear()
A_Functies.Fill(DsFuncties)
For RowLoopIndex = 0 To (DsFuncties.Tables("Functies").Rows.Count - 1)
If DsFuncties.Tables("Functies").Rows(RowLoopIndex).Item("FunctieID") = Func_ID Then
Func_naam = (DsFuncties.Tables("Functies").Rows(RowLoopIndex).Item("Functienaam"))
DDL_Functie.SelectedIndex = RowLoopIndex + 1
Exit For
End If
Next
Func_ID has been declared as follows:
Public Property Func_ID() As Guid
Get
If Not viewstate("Func_ID") Is Nothing Then
Return viewstate("Func_ID")
End If
End Get
Set(ByVal Value As Guid)
viewstate("Func_ID") = Value
End Set
End Property

On the red line I got the following tooltip (error):
Operator '=' is not defined for types 'System.Object' and 'System.Guid'.
How can I define '=' and eg. '&' for type System.Guid ?? Or another solution ??
Help is appreciated, Ger.This is the solution:
If DsFuncties.Tables("Functies").Rows(RowLoopIndex).Item("FunctieID").ToString() = Func_ID.ToString() Then
Hope this helps others too...
regards, Ger.



|||The underlying issue with that exception is you're validating two separate types.
By converting the type System.Object to System.GUID, it would be easier to work with.

Func_ID().Equals(CType(DsFuncties.Tables("Functies").Rows(RowLoopIndex).Item("FunctieID"), GUID))
That would be a more appropriate method than to cast both into strings then evaluate.
|||Hey KraGiE, thanks for the advice.
With your help I become a rather good programmer, (I hope).
regards from the North Sea.

Sunday, February 12, 2012

Analysis Services help - Dim builds, but cube fails.

If there are any AS gurus out there, I could use some help. I've been having some problems with particular AS dimension and cubes and it's driving me crazy! It doesn't matter what I do, nothing seems to work.

Anyway, here's what I'm trying to do. I've got a fairly simple dimension. There is a date stored in the dimension that is formatted as an int. The dimension needs to only display AGE, so I cast the int as a date and do a datediff to get AGE. The dimension builds just fine and I get the results I want. My problem is when I add the dimension to the cube. The cube fails to build and I get an error message - "Data source provider error: The column prefix 'MY TABLE' does not match with a table name or alias used in the query." Basically, AS is telling me that the table that is used for the dimension doesn't exist, even though the fact and the dimension are joined properly and I've validated the structure.

I've run a number of queries in QA on the two tables and everything works fine. No funky data issues. I've run the service packs a few times, but that didn't work either. I've tried making a cube that only has the just fact table and the one dimension table, and it still fails.

Basically, I'm out of ideas. Any help that anyone has is greatly appreciated.My first suggestion would be to examine Brett's excellent sticky (http://www.dbforums.com/t1196943.html) with suggestions for getting quick answers. You certainly appear to have done your homework in understanding the problem, but haven't done much to help me understand it!

If that error message is literally what AS reports, I suspect that the problem is the space in the 'MY TABLE' name. If you use characters outside of letters, digits, and underscores in your object names (like your space), then you need to use square brackets [] to surround that name.

-PatP|||My first suggestion would be to examine Brett's excellent sticky (http://www.dbforums.com/t1196943.html) with suggestions for getting quick answers. You certainly appear to have done your homework in understanding the problem, but haven't done much to help me understand it!

If that error message is literally what AS reports, I suspect that the problem is the space in the 'MY TABLE' name. If you use characters outside of letters, digits, and underscores in your object names (like your space), then you need to use square brackets [] to surround that name.

-PatP

Sorry. The table isn't actually called 'MY TABLE'. I was just using that as a generic reference. The real table name is 'F_LOAN'.

Pat, do you have any specifc questions I can answer? Are you pretty familiar with AS? In a nutshell, I have a dimesion that builds just fine. When I add it to the cube, the cube fails to build. I'm guessing that I'm completely missing something very basic or I've got a bug. :eek:

I've added some screen shots of the cube, the error and the dimension. A pic is worth a thousand words, right?|||A little more info...

If I remove the dimension logic that calcs the Loan Age, the cube will build. However, I don't understand how the logic could be a problem when the dim builds fine with the logic. I would expect the dimension to fail if there was a problem with the Loan Age calc logic.|||One more pic. This query is doing what I want the dimension to do.|||Well, I think I've got it solved. I know everyone was waiting with bated breath! :D

Evidently, the cube didn't like having a dim where the dim converted the date, stored as an int in the DB, to a date. Even though the dim was working just fine, the cube somehow couldn't handle it. So, I made a view based on my dim table and did the int-to-date conversion there. Then I used the view as the source for my dim. And...everything worked just fine. I guess I was just asking too much from AS.

Thanks.

Analysis Services Data Source Cube vs Dim

Hi group

I am creating a cube where the facr table is held in one sql database/data source and the dimension info in another sql database/data source.

When I try to include the dimension in the cube the dimension is not available.

How do I get around this?

Thanks in advance

ChrisHave you tried creating virtual dimensions over your existing dimensions?