This is tricky because DirectElim is informational only and displays eliminations at the first common parent entity but does not roll up to the Top member. If the POV is set to O#Top would be excluded since it never aggregates up.
The Cube View here works because it explicitly set O#DirectElim in the POV.
You could try using FDX to export your cubeview to a csv file. Here is how I might do it:
Imports System
Imports System.Data
Imports System.IO
Imports System.Text
Imports System.Globalization
Imports System.Collections.Generic
Imports Microsoft.VisualBasic
Imports OneStream.Shared.Common
Imports OneStream.Shared.Wcf
Imports OneStream.Shared.Engine
Imports OneStream.Shared.Database
Imports OneStream.Stage.Engine
Imports OneStream.Stage.Database
Imports OneStream.Finance.Engine
Imports OneStream.Finance.Database
Namespace OneStream.BusinessRule.Extender.FDX_DirectElimExport
Public Class MainClass
Private Const FolderPath As String = "Documents/Public"
Private Const CubeViewName As String = "DirectElim_Export"
Private Const WorkspaceName As String = "YourWorkspace"
Public Function Main(
si As SessionInfo,
globals As BRGlobals,
api As Object,
args As ExtenderArgs) As Object
Try
Select Case args.FunctionType
Case Is = ExtenderFunctionType.Unknown
Me.ExportDirectElim(si)
End Select
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
Return Nothing
End Function
' Runs the FDX CubeView extract against DirectElim_Export and writes
' the result to CSV. The Cube View must set O#DirectElim in its Origin
' filter; entity, scenario, and time are the only runtime overrides.
Private Sub ExportDirectElim(si As SessionInfo)
Dim entityFilter As String = "E#Root.Base"
Dim scenarioFilter As String = "S#Actual"
Dim timeFilter As String = "T#2025M1"
Dim fileLabel As String = _
"DirectElim_Export_" & DateTime.Now.ToString("yyyyMMdd")
Dim workspaceId As Guid = _
BRApi.Dashboards.Workspaces.GetWorkspaceIDFromName( _
si, False, WorkspaceName)
Dim dt As DataTable = BRApi.Import.Data.FdxExecuteCubeView( _
si, workspaceId, CubeViewName, _
"Entity", entityFilter, _
"Scenario", scenarioFilter, _
timeFilter, Nothing, False, True, Nothing, 8, True)
If dt Is Nothing OrElse dt.Rows.Count = 0 Then
BRApi.ErrorLog.LogMessage(si, _
"FDX_DirectElimExport: no rows returned. " & _
"Verify O#DirectElim is set in the Cube View " & _
"and data exists for the requested POV.")
Return
End If
Me.WriteToCsv(si, dt, fileLabel)
End Sub
' Serializes a DataTable to CSV and writes it to the public store.
Private Sub WriteToCsv(
si As SessionInfo,
dt As DataTable,
fileLabel As String)
Dim sb As New StringBuilder()
Dim headers As New List(Of String)()
For Each col As DataColumn In dt.Columns
headers.Add(Me.CsvField(col.ColumnName))
Next
sb.AppendLine(String.Join(",", headers))
For Each row As DataRow In dt.Rows
Dim fields As New List(Of String)()
For Each col As DataColumn In dt.Columns
fields.Add(Me.CsvField(row(col)))
Next
sb.AppendLine(String.Join(",", fields))
Next
Dim fileName As String = fileLabel & ".csv"
Dim fileBytes As Byte() = _
New UTF8Encoding(True).GetBytes(sb.ToString())
Dim xfFile As New XFFile()
xfFile.FileInfo.Name = fileName
xfFile.FileInfo.FolderFullName = FolderPath
xfFile.ContentFileBytes = fileBytes
BRApi.FileSystem.InsertOrUpdateFile(si, xfFile)
BRApi.ErrorLog.LogMessage(si, _
"FDX_DirectElimExport wrote " & dt.Rows.Count & _
" rows to " & FolderPath & "/" & fileName)
End Sub
' Quotes a CSV field if it contains commas, quotes, or line breaks.
Private Function CsvField(value As Object) As String
If value Is Nothing OrElse value Is DBNull.Value Then
Return String.Empty
End If
Dim s As String = Convert.ToString(value, _
CultureInfo.InvariantCulture)
If s.Contains(",") OrElse s.Contains("""") _
OrElse s.Contains(vbCr) OrElse s.Contains(vbLf) Then
s = """" & s.Replace("""", """""") & """"
End If
Return s
End Function
End Class
End Namespace