Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to write script for this query

how to write script for this query.


If "Security or Cash" column matches Stock List in "Volatilities" then = Stock
Else column name matches Bond list in Volatilities then = Bond
Else = Cash

4 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

What's in "Volatilities" and where is it located (in what table)?

Not applicable
Author

Volatilities is a table which contains stock list field and bond list  field.

and security or cash  is a field in another table which contains all stock,bond cash.

Anonymous
Not applicable
Author

if you want to do ir in te script do something like this:

Table:

load

if (Security = Stock or Cash = Stock,Stock,

     if(Security = Bond or Cash = Bond ,Bond ,Cash)) as YourColumName

sql select * from Volatilities inner join Table on Volatilities.ID=Table.ID;

if you want to keep it in two tables you must have an ID in common and put into a simple table:

if (Security = Stock or Cash = Stock,Stock,

     if(Security = Bond or Cash = Bond ,Bond ,Cash))

if it doesn´t work send more information

MarcoWedel

‌please post some sample data / application and your expected result.

thanks

regards

Marco