Display text field or other Member Filter in BI Viewer dashboard for dimensions

KevinEvange
New Contributor II

Hey everyone,

Is it possible to display either a text field or any other member filter in BI Viewer Dashboard?

When using a CubeViewMD data adapter, I notice that even if the cube view being referenced uses :Name(XFMemberProperty(DimType=Account, Member=|MFAccount|, Property=Text3)) in the cube view it will display the dimension name in the dashboard instead of Text3 the way it does in the cube view?

thank you.

 

1 ACCEPTED SOLUTION

aformenti
Contributor II

Hi - I realized there was an Issue on that line of code, see it corrected:

Dim ScenarioTypeId As Integer = ScenarioType.GetItem(ScenarioTypeName).Id

Full Br:

	'{GetDataSet}{DataSetName}{ScenarioTypeName=[Actual],Time=[|WFTime|]}
		Public Function GetCubeViewMDData(ByVal si As SessionInfo, ByVal args As DashboardDataSetArgs, ByVal DataAdapterName As String) As DataTable
			Try
				'Gets data from the Cube View MD Data Adapter:
				Dim objDataSet As DataSet = BRApi.Dashboards.Process.GetAdoDataSetForAdapter(si, False, DataAdapterName, "CubeViewMD", args.CustomSubstVars)
				Dim dt As DataTable = objDataSet.Tables(0).Copy()
				
				'Get args:
				Dim ScenarioTypeName As String = args.NameValuePairs.XFGetValue("ScenarioTypeName",String.Empty)
				Dim Time As String = args.NameValuePairs.XFGetValue("Time",String.Empty)
				Dim ScenarioTypeId As Integer = ScenarioType.GetItem(ScenarioTypeName).Id
				Dim TimeId As Integer = BRApi.Finance.Members.GetMemberId(si, dimtypeid.Time,Time)
				
				'Loops through Table and pulls Text3 
				If (Not dt Is Nothing)
					For Each srow As DataRow In dt.Rows
						'Pull the Account Name (Should be pointed to the right Account Field Name ("Account"):
						Dim AccountName As String = srow("Account").item
						Dim AccountId As Integer = BRApi.Finance.Members.GetMemberId(si,dimtypeid.Account,AccountName)
						Dim AccountText As String = BRApi.Finance.Account.Text(si,AccountId,3,ScenarioTypeId,TimeId)
						'Repoints the Account Field for Text Property:
						srow("Account") = AccountText
					Next sRow
					Return dt
				End If 
				
				Return Nothing
			
		Catch ex As Exception
			Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
		End Try
	End Function

 

 

View solution in original post

6 REPLIES 6

aformenti
Contributor II

Hi @KevinEvange,

I don't believe the XFMemberProperty() will work when executed into a CubeViewMD. The only way I could see to achieve what you trying to do is by creating a Data Set Business Rule that calls the Cube View MD Data Adapter, loops through the Data Table and adds the Text Property based on the Account Name by Data Row. 

If you don't know how to do that I am happy to look for an example and send it through. 

Hope that helps, 

 Albert

KevinEvange
New Contributor II

thank you @aformenti ! if you are able to provide me with an example I would greatly appreciate it. It sounds like this would solve my issue.

aformenti
Contributor II

Hi @KevinEvange ,

No problem. The following code could be used as part of the Data Set Business Rule. You pass in the the original data adapter name and loop through the resulting Data Table and manipulate as needed (ie: Pulling Text3 Property).

		'{GetDataSet}{DataSetName}{ScenarioTypeName=[Actual],Time=[|WFTime|]}
		Public Function GetCubeViewMDData(ByVal si As SessionInfo, ByVal args As DashboardDataSetArgs, ByVal DataAdapterName As String) As DataTable
			Try
				'Gets data from the Cube View MD Data Adapter:
				Dim objDataSet As DataSet = BRApi.Dashboards.Process.GetAdoDataSetForAdapter(si, False, DataAdapterName, "CubeViewMD", args.CustomSubstVars)
				Dim dt As DataTable = objDataSet.Tables(0).Copy()
				
				'Get args:
				Dim ScenarioTypeName As String = args.NameValuePairs.XFGetValue("ScenarioTypeName",String.Empty)
				Dim Time As String = args.NameValuePairs.XFGetValue("Time",String.Empty)
				Dim ScenarioTypeId As Integer = ScenarioType.GetItem("ScenarioTypeName").Id
				Dim TimeId As Integer = BRApi.Finance.Members.GetMemberId(si, dimtypeid.Time,Time)
				
				'Loops through Table and pulls Text3 
				If (Not dt Is Nothing)
					For Each srow As DataRow In dt.Rows
						'Pull the Account Name (Should be pointed to the right Account Field Name ("Account"):
						Dim AccountName As String = srow("Account").item
						Dim AccountId As Integer = BRApi.Finance.Members.GetMemberId(si,dimtypeid.Account,AccountName)
						Dim AccountText As String = BRApi.Finance.Account.Text(si,AccountId,3,ScenarioTypeId,TimeId)
						'Repoints the Account Field for Text Property:
						srow("Account") = AccountText
					Next sRow
					Return dt
				End If 
				
				Return Nothing
			
		Catch ex As Exception
			Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
		End Try
	End Function

 

 

 

 

aformenti
Contributor II

Hi - I realized there was an Issue on that line of code, see it corrected:

Dim ScenarioTypeId As Integer = ScenarioType.GetItem(ScenarioTypeName).Id

Full Br:

	'{GetDataSet}{DataSetName}{ScenarioTypeName=[Actual],Time=[|WFTime|]}
		Public Function GetCubeViewMDData(ByVal si As SessionInfo, ByVal args As DashboardDataSetArgs, ByVal DataAdapterName As String) As DataTable
			Try
				'Gets data from the Cube View MD Data Adapter:
				Dim objDataSet As DataSet = BRApi.Dashboards.Process.GetAdoDataSetForAdapter(si, False, DataAdapterName, "CubeViewMD", args.CustomSubstVars)
				Dim dt As DataTable = objDataSet.Tables(0).Copy()
				
				'Get args:
				Dim ScenarioTypeName As String = args.NameValuePairs.XFGetValue("ScenarioTypeName",String.Empty)
				Dim Time As String = args.NameValuePairs.XFGetValue("Time",String.Empty)
				Dim ScenarioTypeId As Integer = ScenarioType.GetItem(ScenarioTypeName).Id
				Dim TimeId As Integer = BRApi.Finance.Members.GetMemberId(si, dimtypeid.Time,Time)
				
				'Loops through Table and pulls Text3 
				If (Not dt Is Nothing)
					For Each srow As DataRow In dt.Rows
						'Pull the Account Name (Should be pointed to the right Account Field Name ("Account"):
						Dim AccountName As String = srow("Account").item
						Dim AccountId As Integer = BRApi.Finance.Members.GetMemberId(si,dimtypeid.Account,AccountName)
						Dim AccountText As String = BRApi.Finance.Account.Text(si,AccountId,3,ScenarioTypeId,TimeId)
						'Repoints the Account Field for Text Property:
						srow("Account") = AccountText
					Next sRow
					Return dt
				End If 
				
				Return Nothing
			
		Catch ex As Exception
			Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
		End Try
	End Function

 

 

HI @KevinEvange ,

Did you have a chance to review the proposed solution?

 

@aformenti, thank you so much for this, I believe this will work!