Wrapping to year not starting on Jan 1

Discussion forum for PivotCubeX component. Common usage questions. Bug and problem reports

Moderator: Alex Zencovich

Wrapping to year not starting on Jan 1

Postby vittorio » Sun Oct 08, 2006 8:10 pm

I have to wrap data to years starting on 1 nov and ending on 31 oct.
I think I should use wtCustom, but have no idea how to.
After wrapping the dimension to wtCustom, how can I give it the customized values?

Thanks!
vittorio
User
 
Posts: 5
Joined: Sun Jul 30, 2006 9:24 pm

Postby AlexZencovich » Mon Oct 09, 2006 5:53 am

You should use your own OnCustomWrap event routine. Like it work in MS Access demo. Here you should to setup ID and Name values for dimension according to FieldName(FactTable) value you pass in.

Private Sub PCX_OnCustomWrapData(ByVal AliasName As String, ByVal Value As Variant, ID As Long, Name As String)
If AliasName = "Season" Then
If (Month(Value) = 1) Or (Month(Value) = 2) Or (Month(Value) = 12) Then
ID = 1
Name = "Winter"
ElseIf (Month(Value) = 3) Or (Month(Value) = 4) Or (Month(Value) = 5) Then
ID = 2
Name = "Spring"
ElseIf (Month(Value) = 6) Or (Month(Value) = 7) Or (Month(Value) = 8) Then
ID = 3
Name = "Summer"
ElseIf (Month(Value) = 9) Or (Month(Value) = 10) Or (Month(Value) = 11) Then
ID = 4
Name = "Autumn"
End If
End If
If AliasName = "Quarter" Then
If (Month(Value) = 1) Or (Month(Value) = 2) Or (Month(Value) = 3) Then
ID = 1
Name = "1st Quarter"
ElseIf (Month(Value) = 4) Or (Month(Value) = 5) Or (Month(Value) = 6) Then
ID = 2
Name = "2nd Quarter"
ElseIf (Month(Value) = 7) Or (Month(Value) = 8) Or (Month(Value) = 9) Then
ID = 3
Name = "2rd Quarter"
ElseIf (Month(Value) = 10) Or (Month(Value) = 11) Or (Month(Value) = 12) Then
ID = 4
Name = "4th Quarter"
End If
End If
End Sub
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am


Return to PivotCube ActiveX

Who is online

Users browsing this forum: No registered users and 4 guests

cron