Skip to main content
Expert
Jul 29, 2022 2:44 PM UTC
Solved

ClearStageData

Hi,

I'd like to use the ClearStageData function within a business rule.

I am already successfully using other similar functions like ExecuteParseAndTransform or LoadCube.

This is the sample given within OneStream: Dim objLoadTransformProcessInfo As LoadTransformProcessInfo = BRApi.Import.Process.ClearStageData(si, wfClusterPk, sourceId)

 

The issue I have with the ClearStageData function is that I don't understand what I should pass as sourceId. Can any of you clarify it or point me to any relevant documentation?

Thank you

ChristianW
Employee - Advisor
Jul 29, 2022 3:15 PM UTC

This:

ChristianW_2-1659107749582.png

 

 or

ChristianW_1-1659107669759.png

it is just a string ("All" or "" might work as well, but I didn't try it).

 

4 replies

Jul 29, 2022 3:14 PM UTC

I would recommend reviewing the Source ID concept in the Design and Reference Guide.  The Source ID is determined by the value set in the Data Source and is populated for each data record during the Import process in Stage.   

TonyToniTone_0-1659107127363.png

In most cases, data records loaded to the Staging tables are transformed and validated prior to loading to the Cube. If you clear out the data records in Stage, it doesn't mean that you clear data from the Cube.  You break the link between the data records from the Stage to the Finance Engine.  Therefore, you have data in the Cube but no audit back to the data records in Stage that make up that Cube data.  Not sure how you plan on using this function but something to keep in mind

AndreaFAuthor
Expert
Aug 1, 2022 8:58 AM UTC

Thank you for your reply. I plan to use the function as a preliminary step before using the ExecuteParseAndTransform function within an extensibility rule.

ChristianW
Employee - Advisor
Employee - Advisor
Jul 29, 2022 3:15 PM UTC

This:

ChristianW_2-1659107749582.png

 

 or

ChristianW_1-1659107669759.png

it is just a string ("All" or "" might work as well, but I didn't try it).

 

Member
Jun 7, 2023 4:34 PM UTC

HEllo

I can confirm as I try to do the same thing, for SourceID you have to use "" (I'm trying this) or maybe string.empy (not tested) . And it works pretty fine if you have multiple files loaded in you stage aera