LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Set default null values for Pivot Table

    Employee
    Posted 11-13-2018 21:45

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: hycoptus

    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
    userID toys numberOfToys
    123 teddyBear 1
    123 doll 2
    456 doll 2
    456 truck 1
    Pivot Table
    userID teddyBear doll truck
    123 1 2 NULL
    456 NULL 2 1
    Desired Pivot Table
    userID teddyBear doll truck
    123 1 2 0
    456 0 2 1


  • 2.  RE: Set default null values for Pivot Table

    Employee
    Posted 11-20-2018 14:12

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: gmullin

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

    PivotNULL.brg