Results 1 to 2 of 2

Thread: Set default null values for Pivot Table

  1. #1

    Default Set default null values for Pivot Table

    Hi,

    I've created a pivot table using the Pivot Table node where I used 'Sum' as the aggregation type. For values that do not exist, 'null' is the default value. However, I would like to set a default value of 0 instead.
    As there are many types of toys, I need a way to automatically replace the NULLs with a default value of 0. Is there any advice? Thanks.

    Initial Table
    Code:
    userID toys numberOfToys
    123 teddyBear 1
    123 doll 2
    456 doll 2
    456 truck 1
    Pivot Table
    Code:
    userID teddyBear doll truck
    123 1 2 NULL
    456 NULL 2 1
    Desired Pivot Table
    Code:
    userID teddyBear doll truck
    123 1 2 0
    456 0 2 1

  2. #2
    Lavastorm Employee gmullin's Avatar
    Join Date
    May 2014
    Location
    Chicago
    Posts
    185

    Default

    I'm not sure if there's a quicker way to do this, but this should get you the result you need.

    PivotNULL.brg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •