Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Re: how to write script for this query

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

Not applicable

Re: how to write script for this query

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.

promaniuk
New Contributor III

Re: how to write script for this query

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

Re: how to write script for this query

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

thanks

regards

Marco

Community Browser