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.  Crosstabulate using Pivot node: can't get it to work :-(

    Employee
    Posted 04-29-2013 04:19

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

    Originally posted by: SambaDancer

    Dear all,
    I am so almightily frustrated with the "Pivot - Data To Names" node. Please could someone help me out?
    Please see attached brg. What I would like as the outcome is 1 line for each instance of CODE and 1 column for each instance of PERIOD.
    But in my result, the value for field CODE is repeated 38 time (only the last CODE is shown, 38 times).
    If I choose CODE as the field in GroupBy, I get the error message as below.
    Why is this soooooooooooooooooo difficult?!?!
    (I'm using BRE 4.6.0.1 build 457).
    Thank you so much in advance!!
    Best regards, Bart.

    error message:
    -- Errors for GroupByPath
    -- Errors for DataToNamesWithGroupBy
    2013-04-29 13:14:30.796; ERROR: Error on input record 1. Number of field names does not match number of data items to pivot.\r\nReceived 5 names, and 6 data items.\r\nNames Array: 1;2;3;4;5.\r\nData Array: 2.06150000000000010000e+002;/n;/n;/n;/n
    id: 5 chain: 0 group: 0
    javaDetail: com.lavastorm.brain.node.core.DataToNamesWithGroup By.processRecords(DataToNamesWithGroupBy.java@389)
    dataDetail:
    GroupedData(in) row: 1
    columns: ['CODE', 'java.lang.String'], ['__metadataNames__', 'java.lang.String'], ['__groupedData__', 'java.lang.String']
    records:
    [Null, 1;2;3;4;5, 2.06150000000000010000e+002;/n;/n;/n;/n]
    Metadata(in) row: 1
    columns: ['__NamesMetadata__', 'java.lang.String'], ['__DataType__', 'java.lang.String']
    records:
    [Null, Null]
    PivotedData(out) row: 0
    columns: ['CODE', 'java.lang.String'], ['1', 'java.lang.Double'], ['2', 'java.lang.Double'], ['3', 'java.lang.Double'], ['4', 'java.lang.Double'], ['5', 'java.lang.Double']

    2013-04-29 13:14:30.805; ERROR: Node failed.
    id: 7 chain: 6 group: 0
    javaDetail: com.lavastorm.brain.execution.java.node.NodeWrappe r.run(NodeWrapper.java@769)
    Attachments:
    Pivot_Test.brg


  • 2.  RE: Crosstabulate using Pivot node: can't get it to work :-(

    Employee
    Posted 04-29-2013 05:47

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

    Originally posted by: ltolleson

    What are you trying to do with the Amount field? You can't pivot on two different fields. You can either pivot on Code or on Amount. Based on the output you described you should use the following.

    NamesField = PERIOD
    DataField = CODE
    GroupBy = leave empty


  • 3.  RE: Crosstabulate using Pivot node: can't get it to work :-(

    Employee
    Posted 04-29-2013 06:29

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

    Originally posted by: ltolleson

    Bart,

    After a little more digging I found the problem is with the data. For some reason the node errors when using the group by when the data field contains null values. I have attached a new version of your graphs that includes a filter node that changes any nulls to 0.0. This should give you the desired output.

    Hope this helps.

    Larry

    Pivot_Test.brg


  • 4.  RE: Crosstabulate using Pivot node: can't get it to work :-(

    Employee
    Posted 04-29-2013 07:18

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

    Originally posted by: Tim Meagher

    Hi,

    This is an issue with Pivot - Data To Names node which exists in LAE 4.5.4 and LAE 4.6.0.

    The problem occurs when you have a GroupBy field specified, and after sorting the data by the GroupBy field, the last value in the Data field for that grouping is null.

    It has been raised in our bug tracking system as issue # 4804, and will be fixed in the upcoming LAE 4.5.5 and LAE 4.6.1 releases.

    Regards,
    Tim.


  • 5.  RE: Crosstabulate using Pivot node: can't get it to work :-(

    Employee
    Posted 05-07-2013 03:04

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

    Originally posted by: SambaDancer

    Great, thanks!


  • 6.  RE: Crosstabulate using Pivot node: can't get it to work :-(

    Employee
    Posted 05-07-2013 03:04

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

    Originally posted by: SambaDancer

    Thank you so much!