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

Rotate Basics

  • 1.  Rotate Basics

    Employee
    Posted 06-23-2009 13:54

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

    Originally posted by: phourigan_MDS

    Hi Folks,

    I have a very simple question about the Rotate node.

    Imagine I have a static input.
    Category, Result
    Add, 100
    Edit, 101,
    Delete, 5
    Add, 1
    Edit, 99
    Delete, 98

    I want to transpose this data to form the following output.

    Add, Edit, Delete
    100, 101, 5
    1, 99, 98

    In my Rotate node I select Category and Result as the name and value fields respectively.

    The problem is I end up with a single line output, with no pivot around the delete.

    How would I specify a pivot for this data? Or am I mis-interpreting the use of the Rotate Node?

    thanks
    --ph


  • 2.  RE: Rotate Basics

    Employee
    Posted 06-24-2009 14:18

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

    Originally posted by: rboccuzzi

    You have the right basic idea. A pivot column works by having the same value for each group; when the value changes, that's when the group restarts. For you to do this, you would want your data to look like this:

    Category, Result, Pivot
    Add, 100, 1
    Edit, 101, 1
    Delete, 5, 1
    Add, 1, 2
    Edit, 99, 2
    Delete, 98, 2

    and then you put in Pivot as your pivot column, and you will get your desired output.

    cheers
    Rich


  • 3.  RE: Rotate Basics

    Employee
    Posted 07-07-2009 21:44

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

    Originally posted by: phourigan_MDS

    Hi,

    Thanks for that, works well!


  • 4.  RE: Rotate Basics

    Employee
    Posted 10-19-2009 16:01

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

    Originally posted by: burke

    Can the order of the output be changed ala MS Excel?

    In Excel a pivot table has the Pivot Field(s) as the first column(s) and the Value Field(s) are to the right of it, it seems LS output does the reverse of this.

    Any thoughts as to how to revers this? I was going to use a filter however I am not exactly sure how to use a variable to change the field header in this case since it is based on the input data.


  • 5.  RE: Rotate Basics

    Employee
    Posted 10-20-2009 08:18

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

    Originally posted by: burke

    I think I have solved this with a filter node, although it seems 'hackish' to me.

    emit 
    	'Root Cause Consolidation' as "RC",
    	*
    	exclude 'Root Cause Consolidation'
    Basically I am duplicating the column I want to be leftmost and then excluding it from the output.


  • 6.  RE: Rotate Basics

    Employee
    Posted 10-21-2009 07:44

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

    Originally posted by: rboccuzzi

    I am not exactly sure of your above question, but it seems, based on your own solution, that you wanted to just order the output column...is this for viewing inside the BRDViewer? Or for an output node, such as CSV File? Or to view inside Excel?

    If you are looking at the results in the BRD Viewer, you can reorder the columns right from the viewer. If you want to export to Excel and using the BRD Viewer for exporting is an option, then you will get the columns in that order, I believe. Does that answer your question?

    The order of the columns inside the data is not guaranteed or determined; but currently, if you list explicit fields as you have done, they do move to the front.

    Cheers
    Rich


  • 7.  RE: Rotate Basics

    Employee
    Posted 10-21-2009 11:17

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

    Originally posted by: burke

    Thanks for the reply.

    When producing a pivot in Excel or using the rotate node the column names are determined by the data - the 'NameField' in LS. LS outputs the results with the columns ordered by the ValueField then the PivotField, what I was after was PivotField, ValueField as the order of columns. What I have works.

    However it seems this node only works when the NameField has only one value.

    I have data with following format:
    'Period','Root Causes','Count'
    "2009-01","Some Root Cause", 35
    "2009-02","Some Root Cause", 25
    "2009-03","Some Root Cause", 32
    "2009-02","Another Root Cause", 3
    "2009-03","One More Root Cause", 5
    I had expected the results to look something like this:
    'Root Causes','2009-01','2009-02','2009-03'
    "Some Root Cause",35,25,32
    "Another Root Cause",0,3,0
    "One More Root Cause",0,0,5
    Instead I have had to filter the data based on 'Period' and use a separate rotate and then concatenate the results to get the expected result.

    Am I missing something?

    Thanks in advance.


  • 8.  RE: Rotate Basics

    Employee
    Posted 10-21-2009 11:24

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

    Originally posted by: stonysmith

    Try these nodes below.. just copy them from here and paste into BRE.


    node:Static_Data
    bretype:core::Static Data
    editor:sortkey=4adf4e9a56281f6e
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    Period,RootCauses,Count:int
    2009-01,Some Root Cause,35
    2009-02,Some Root Cause,25
    2009-03,Some Root Cause,32
    2009-02,Another Root Cause,3
    2009-03,One More Root Cause,5
    EOX
    editor:XY=820,470
    end:Static_Data

    node:Rotate
    bretype:core::Rotate
    editor:sortkey=4adf4eeb5da374dd
    input:@41ed69d44ac129e8/=Static_Data.40fe6c55598828e5
    output:@41ed69d463e35590/=
    prop:NameField=Period
    prop:PivotField=RootCauses
    prop:ValueField=Count
    editor:XY=910,470
    end:Rotate


  • 9.  RE: Rotate Basics

    Employee
    Posted 10-21-2009 15:03

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

    Originally posted by: burke

    Results below, I actually tried this - perhaps I should have shown what I was getting for results.

    2009-01	2009-02	2009-03	Root Causes
    35	25	32	Some Root Cause
    3	Another Root Cause	32	Some Root Cause
    5	One More Root Cause	32	Some Root Cause


  • 10.  RE: Rotate Basics

    Employee
    Posted 10-21-2009 15:25

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

    Originally posted by: burke

    Interesting it works fine in 4.1.4 but not in the older 4.1.1.0 Build 243 which I have been using.


  • 11.  RE: Rotate Basics

    Employee
    Posted 10-23-2009 11:36

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

    Originally posted by: rboccuzzi

    There was an issue fixed in Rotate in 4.1.4. Looks like you are all set now? (Once you re-ran what you needed to on 4.1.4). Is that correct?