Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Is it possible to use QV functions in SQL and inline

I know variables can be used in SQL & inline.

E.g:

[Code]

let var_1 = 1;

sql_tab:

SQL select name from employee where id=$(var_1);

inline_tab:

load * inline [

test

$(var_1)

];

[/Code]

But, that means I have to define many variables, too many variables will be hard to management.

So, is it possible to use QV functions in SQL & inline? Below is the example, but it doesn't work.

E.g:

[Code]

sql_tab:

SQL select * from emp_salary where salary_date=Date#('2012-01-01','YYYY-MM-DD'); //highlighted in red is a function of QV

inline_tab:

load * inline [

test

Date#('2012-01-01','YYYY-MM-DD')

];

[/Code]


I also tried using $() around the QV function, not work.

2 Replies
Not applicable

Is it possible to use QV functions in SQL and inline

hi,

You cannot use QV functions in SQL statements because these are database specific, i.e you can use only sql function .

for inline load you can try as:

A:

Load Date#(Month,'MMM') as Month_new Resident  tech1_inline;

where tech1_inline is an inline table

Regards:

Arun Goel

jvitantonio
Valued Contributor III

Re: Is it possible to use QV functions in SQL and inline

Hi, ok, now, you need to have in mind that you cannot use QV funtions in an SQL statement. The function you are trying to use is also supported by any DB engine. You just need to look for the right sintax.

Now, if you want to use a function in an inline table, you can do like this:

inline_tab:

load date(test,'YYYY-MM-DD') AS TEST inline [

test

'2012-01-01'

];

Community Browser