The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
particle
3 years agoNew Contributor II
FdxExecuteCubeView parameters
If I build a cubeview that contains the desired POV and functions on its own, using FdxExecuteCubeView seems to work great. However, there is no documentation available on actually using the FDX func...
- 3 years ago
You're not missing anything obvious, it's the documentation that's missing...
From some internal resources, i see a comment like this over all the "filter" parameters of FdxExecuteCubeView:
'when the extracted cube view references an entity parameter called |!FDXEntity!|, this field needs to be set to the name of the entity dimension the extracted entities exist in 'if the cube view does not use an entity parameter called |!FDXEntity!| then this field can be left blank "" or as String.Empty Dim entityDimName As String = args.NameValuePairs.XFGetValue("", String.Empty) 'when the extracted cube view references an entity parameter called |!FDXEntity!|, this field needs to be set to an entity member filter that controls the extracted entities based on the member filter 'if the cube view does not use an entity parameter called |!FDXEntity!| then this field can be left blank "" or as String.Empty Dim entityMemFilter As String = args.NameValuePairs.XFGetValue("", String.Empty) 'when the extracted cube view references an scenario parameter called |!FDXScenario!|, this field needs to be set to the name of the scenario dimension the extracted scenarios exist in 'if the cube view does not use a scenario parameter called |!FDXScenario!| then this field can be left blank "" or as String.Empty Dim scenarioDimName As String = args.NameValuePairs.XFGetValue("", String.Empty) 'when the extracted cube view references a scenario parameter called |!FDXScenario!|, this field needs to be set to an scenario member filter that controls the extracted scenarios based on the member filter 'if the cube view does not use a scenario parameter called |!FDXScenario!| then this field can be left blank "" or as String.Empty Dim scenarioMemFilter As String = args.NameValuePairs.XFGetValue("", String.Empty) 'when the extracted cube view references a time parameter called |!FDXTime!|, this field needs to be set to a time member filter that controls the extracted time periods based on the member filter 'if the cube view does not use a time parameter called |!FDXTime!| then this field can be left blank "" or as String.Empty Dim timeMemFilter As String = args.NameValuePairs.XFGetValue("", String.Empty)So I assume those fields do nothing unless those Parameters are present on the cube view.
Tom
3 years agoNew Contributor III
I"m having trouble with this function FdxExecuteCubeView, anyway you could post your code ? a working example would greatly help. Thanks
Gidon_Albert
2 years agoContributor II
Here's an example for you Tom.
The code below will return a data table with data from the following cube view:
The data table will have the following columns: Cube, Entity, Parent, Cons, Scenario, Time, View, Account, Flow, Origin, IC, UD1, UD2, UD3, UD4, UD5, UD6, UD7,UD8, VCY, VDelta_PY, VDelta_Pct_PY_100
The last three columns (starting with "V") are the amounts (i.e. columns) from the cube view.
The data table will initially have 18 rows, one for each data cell in the cube view.
The filter in the code is limiting the results to only rows that have "Op_Rev" in the Account column and "None" in UD8 column. This will limit the number of rows returned to a single row with a value of 499,272,231 (the top left cell in the cube view).
'Get Name Value Pairs
Dim cvName As String = args.NameValuePairs.XFGetValue("Cube View", String.Empty)
Dim acName As String = args.NameValuePairs.XFGetValue("Account", "")
Dim u8Name As String = args.NameValuePairs.XFGetValue("UD8", "None")
Dim value As Decimal = 0
'While this is not used, it shows how to get the Entity Dim Name from the Entity member name
'Dim enName As String = args.NameValuePairs.XFGetValue("Entity", String.Empty)
'Dim enID As Integer = BRApi.Finance.Members.GetMemberId(si, dimtypeid.Entity, enName)
'Dim enDimID As Integer = BRApi.Finance.Members.GetDimIdFromMemberId(SI, dimtypeid.Entity, enID)
'Dim enDimName As String = BRApi.Finance.Dim.GetDims(si, dimtypeid.Entity).Find(Function(x) x.DimPk.DimId = enDimID).Name
Dim nvbParams As New NameValueFormatBuilder 'this can be empty
Dim filter As New System.Text.StringBuilder
filter.Append("Account=" & "'" & acName & "'")
filter.Append(" AND ")
filter.Append("UD8=" & "'" & u8Name & "'")
Dim cvDT As DataTable = BRApi.Import.Data.FdxExecuteCubeView(si, cvName, "", "", "", "", "", nvbParams, False, True, filter.ToString, 8, False)
If cvDT.Rows.Count > 0
value = cvDT.Rows(0).Item("vCY").ToString
End If
The last three lines in the code simply select the value from the "VCY" column. This value can then be returned to a parameter or another function that calls the BR.
Hope this helps.
- Koemets4 months agoContributor
Thank you very much for your sample. It seems like I can only retrieve one data column. When I try to set the cube view with several columns like you have, the datatable returns an error since it applies the same column name to all data columns. How did you bypass it? Any particular cube view settings you set?
- JackLacava4 months ago
OneStream Employee
What you wrote doesn't seem to match what the function does. Can you please post your code ?
Related Content
- 2 years ago
- 4 months ago
- 2 years ago