Comments

7 comments

  • Official comment
    Saurabh Agashe

    If you're asking how to convert rows in to columns, you can use the GROUPSELECT function. All you need to know is the constant of the value you'd like in each column. Here's the detailed explanation and usage instructions:

    https://documentation.datameer.com/documentation/display/DAS30/Pivoting+with+GROUPSELECT

    I hope that helps!

    Comment actions Permalink
  • enaven

    Hi !

    Thanks for the information on pivoting the table.

    Could you please help me understand hoe to perform the pivot for multiple records. In your example I would want count of age across different country.

    The output would have distinct countries and corresponding count of age across columns.

    Your help would be appreciated!

    Thanks

    0
    Comment actions Permalink
  • Joel Stewart

    enaven, it sounds like these functions would complete your desired analysis: 

    GROUPBY(#MySourceSheet!Country)

    GROUPCOUNT(#MySourceSheet!Age)

    That will provide a distinct list of countries in the first column and a count of the number of records that contain a non-null value for age in the second column. 

    -1
    Comment actions Permalink
  • enaven

    Hi Joel,

    I am sorry if I was not able to correctly articulate  my problem.

    I would like to pivot the table and get a count of age for each country in different columns.

    I understand GROUPSELECT function would help me find the count of age in different columns, but I would want to find this count for a given country (GROUPBY Country and then GroupbySELECT threw an error)

    your approach would indeed give me the required result but it would be across the rows

    0
    Comment actions Permalink
  • Joel Stewart

    You would build that as an intermediate work-sheet and then you could use the GROUPSELECT function to pivot the data on a new sheet.

    0
    Comment actions Permalink
  • srikanth v

    Hi,

    WIth GROUPSELECT function, we can create Pivot with Constant values.. But i have a situation where i want to pivot with Dynamic values. So, how to create Pivot in this case?

    0
    Comment actions Permalink
  • Joel Stewart

    Srikanth, that's not a capability of that function. Can you share an example though? Perhaps there is an alternative method that could be used for your instance. 

    0
    Comment actions Permalink

Please sign in to leave a comment.