Skip to main content

OneStream

Mass Delete Members in OneStream XF

Digital Transformation

During one of my previous projects, we needed to delete approximately 200 accounts that were distributed throughout a large Account dimension. This blog discusses how we solved it.

One approach would have been to delete each account one time. Obviously, that wasn’t appealing as it is time-consuming and can be prone to error.  Another approach is discussed in OneStream knowledge base article KB0010541, which provides a method to create an XML file for one or more members. However, the KB method requires typing the member name one at a time.

Our approach was to create an XML file to mass delete the members.  This method will take an input file and generate the necessary XML syntax.  All you need is access to Microsoft SQL Server with the appropriate permissions.  This solution is applicable for other dimensions UD1-UD8 and can be re-used whenever the need arises if properly setup.  The approach assumes that:

  • All the members are base members
  • You have already identified which members need to be deleted
  • You have a list of these members in a text file or format that can be imported
  • The members identified are not a member in a Journal template

If you don’t have a list, you can use a Cube View, Quick View, or another method to generate the list.  The next step will be to import the list of accounts into a Microsoft SQL Server database using the standard flat file import.

Blog01 01

Blog01 02

Blog01 03

Blog01 04Blog01 05

For reference, a sample of the imported data is displayed.

Blog01 06

With the file successfully imported, the next step will be to create a SQL statement that will output an XML file in the correct format.  The format is shown below.

Notice that each <member > element has two attributes:  name which will be the member name to delete, and action which is specified as =”Delete”.  The action instructs the import process to delete the member.

Blog01 07

Onestream - Modern Accounting: How to Overcome Financial Close Challenges
Modern Accounting: How to Overcome Financial Close Challenges

Improvements in each of the following period-close core tasks can provide transformative change and are reviewed in this guide include closing the books and external reporting, periodic reconciliations, and managing the period-close process.

Get the Guide

The next query creates the XML file.  It has three parts:  a SELECT clause, a FROM clause, and a FOR XML PATH clause.

The SELECT clause “SELECT [MemberName] AS [@name],’Delete’ AS [@action]” will order the results as attributes of the <member>  element.  The ampersand “@” indicates this is an attribute of an element instead of a row element.

The FROM clause is simply the same SQL statement from earlier that returns our list of accounts.

The FOR XML PATH clause specifies the format of the output. It creates a root element called <members> and each row in our list will become an <member> element.

Blog01 08

Blog01 09

The remaining required XML elements are displayed in the next image on lines 2-5 and 10-13.

Note: the <dimension> element has additional attributes which are not displayed. 

Blog01 10

To make things easy, we just overwrite lines 6-9 in the first image with our XML results.  The second image displays the file after the copy and pastes operation.  Save this new file with extension .xml.

Blog01 11

Blog01 12

Before we import our file,  we check that our OneStream application has an Account dimension with 10,367 base members.  We are going to delete 190 of these with our file.

Blog01 13

Now, log into the OneStream application.  Select and expand Application > Tools > Load/Extract.

Navigate to and select the XML file previously created.  Once this is done, select the Load icon.  The load will complete without error which is confirmed by the second image after this paragraph.

Blog01 14

Blog01 15

To confirm the upload did delete members, refresh the OneStream application, and then navigate to the Account dimension and Grid View.  The number of base members has updated from 10,367 to 10,177 which confirms 190 members were deleted.

Blog01 16

I hope this solution is helpful the next time you have to delete numerous members.  If you have any questions, feel free to either post a comment to the blog or email me at terry.ledet@perficient.com.

Thoughts on “Mass Delete Members in OneStream XF”

  1. For all those that don’t have access to create a table on a database there is another method that may be helpful. Using the table values function to build the list.

    Select
    MemberName as [@Name]
    ,’Delete’ as [@Action]
    From (
    select *
    from (values
    (‘A10001’)
    ,(‘A10002’)
    ,(‘A10003’)
    ,(‘A10004’)
    ,(‘A10005’)
    ) T1 (MemberName)
    ) Members
    for xml path (‘member’), root(‘members’)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Terry Ledet, Senior Solutions Architect

Terry is a Senior Solutions Architect at Perficient and a OneStream Certified Professional (OCP) - Lead Architect R1. He is a frequent speaker at Splash and passionate about making clients successful. When not blogging about OneStream, Terry is a husband, parent, and baseball enthusiast.

More from this Author

Categories
Follow Us