kikkerkermit
Programmer
Dear experts,
I want to get a custom date dimension category with a script. De name of the dimension is 'Huidige periode' and its type is custom. The custom dimension is within the date dimension "Tijd(Boekingsdatum)".
Does somenone know how to achieve this ??
My thank will be great
Maarten van Eck
Sub Main ()
Dim Curdate as string
Dim objTransApp As Object
Dim objModel As Object
Dim objDateDim As Object
Dim objDateLevel As Object
Dim strLocation As String
Dim strModelSource As String
Dim strModelPath As String
strLocation = "D:\COGNOS\RETAIL\Delicontrol\Financieel\Powerplay\Model\" 'where you keep your models
strModelSource = "financieel.pyi" ' model name and type
strModelPath = strLocation & strModelSource
Set objTransApp = CreateObject("CognosTransformer.Application")
Set objModel = objTransApp.OpenModel(strModelPath)
Set objDateDim = objModel.Dimensions("Tijd(Boekingsdatum)")
'Here goes it wrong
Curdate = objDatedim.item("huidige periode").name
MsgBox "Current Period:" + Curdate
Set objDateLevel = Nothing
Set objDateDim = Nothing
Set objModel = Nothing
Set objTransApp = Nothing
End Sub
I want to get a custom date dimension category with a script. De name of the dimension is 'Huidige periode' and its type is custom. The custom dimension is within the date dimension "Tijd(Boekingsdatum)".
Does somenone know how to achieve this ??
My thank will be great
Maarten van Eck
Sub Main ()
Dim Curdate as string
Dim objTransApp As Object
Dim objModel As Object
Dim objDateDim As Object
Dim objDateLevel As Object
Dim strLocation As String
Dim strModelSource As String
Dim strModelPath As String
strLocation = "D:\COGNOS\RETAIL\Delicontrol\Financieel\Powerplay\Model\" 'where you keep your models
strModelSource = "financieel.pyi" ' model name and type
strModelPath = strLocation & strModelSource
Set objTransApp = CreateObject("CognosTransformer.Application")
Set objModel = objTransApp.OpenModel(strModelPath)
Set objDateDim = objModel.Dimensions("Tijd(Boekingsdatum)")
'Here goes it wrong
Curdate = objDatedim.item("huidige periode").name
MsgBox "Current Period:" + Curdate
Set objDateLevel = Nothing
Set objDateDim = Nothing
Set objModel = Nothing
Set objTransApp = Nothing
End Sub