BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KiKa
Calcite | Level 5

Hello everyone,

 

I have a data grid as request variable in my event and I want to save the columns as separate lists.

 

Example:

df =

    ANCILLARY  PRICE

    "ABC"           20

    "DEF"           30

 

should be converted into

      ["ABC","DEF"] (character list)

      [20,30] (integer list)

 

I have tried using a process node with Jython code but I wasn't successful using something like

 

list = df.loc(:,"ANCILLARY")  or  list = df[["ANCILLARY"]].tolist()

 

Would be great to get some input on this problem, thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
JamesAnderson
SAS Employee
Hi KiKa,
My apologies - I missed a step. You also need to create an Identifier (of Type Data Grid) and assign the identifier to the Input data grid variable inside the event. So the steps are:

* Create an Identifier of type Data Grid, and define each input column
* Modify the event and assign the Identifier to the Data grid variable
* Open the decision campaign, open the Start node and confirm that the identifier is now present against the data grid
* In your decision campaign, downstream from the Start node, add an Assignment Node
* In the assignment node, add a new "list" variable that matches the data type (character list or Date list etc) of a column from the data grid
* In the Value selection dialogue box for this new variable, you can now browse the list of Event variable, and each column in the data grid (that matches the data type of the new variable in the assignment node) will be available for you to choose. For example if you created a Data Grid called
Regards
James

View solution in original post

4 REPLIES 4
JamesAnderson
SAS Employee
HI,
What version of RTDM are you using ?
Rgds
James
JamesAnderson
SAS Employee

Hi KiKa,

You can do this without code if you would prefer, with the following steps:

  1. In your decision campaign, downstream from the Start node, add an Assignment Node
  2. In the assignment node, add a new “list” variable that matches the data type (character list or Date list etc) of a column from the data grid
  3. In the Value selection dialogue box for this new variable, you can now browse the list of Event variable, and each column in the data grid (that matches the data type of the new variable in the assignment node) will be available for you to choose. For example if you created a Data Grid called              

Regards
James

KiKa
Calcite | Level 5

Hi James,

thanks for your answer. I tried your suloution and created a new list variable in the assignment node. However, the column of data grids do not appear as a selection option. Maybe this is because RTDM does not recognize the format (character/integer etc) of the columns? Is there a way to assign this for each column of a data grid?

 

Thanks for the help and best regards,

KiKa

JamesAnderson
SAS Employee
Hi KiKa,
My apologies - I missed a step. You also need to create an Identifier (of Type Data Grid) and assign the identifier to the Input data grid variable inside the event. So the steps are:

* Create an Identifier of type Data Grid, and define each input column
* Modify the event and assign the Identifier to the Data grid variable
* Open the decision campaign, open the Start node and confirm that the identifier is now present against the data grid
* In your decision campaign, downstream from the Start node, add an Assignment Node
* In the assignment node, add a new "list" variable that matches the data type (character list or Date list etc) of a column from the data grid
* In the Value selection dialogue box for this new variable, you can now browse the list of Event variable, and each column in the data grid (that matches the data type of the new variable in the assignment node) will be available for you to choose. For example if you created a Data Grid called
Regards
James
How to improve email deliverability

SAS' Peter Ansbacher shows you how to use the dashboard in SAS Customer Intelligence 360 for better results.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 2081 views
  • 1 like
  • 2 in conversation