Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Function on JS

Hello,

I encountered with issue about Javascript, maybe someone could help me.

I want to create function on JavaScript and then call it in the script. Could you tell me where I should put it? and What should I do to make it work?

Thanks, Alex

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

You go to the Tools / Edit Module (CTRL+M) to get into the Macro Editor. There you need to select JScript as the Macro Language. JScript is the Microsoft JScript engine that powers all versions of Internet Explorer and is Microsofts version of Javascript.

When you have written one or more Javascript functions they will be available in the load script just as any other built-in function in QlikView. So for instance if you make a Macro that looks like this:

function myFirstJSfunc() {

     return( 123 );

};

You can go into your load script at write something like this:

LET giveMe123 = myFirstJSfunc();

View solution in original post

3 Replies
sinanozdemir
Specialist III
Specialist III

Under the Tools, click on "Edit Module":

Capture.PNG

I believe you can enter VBScript or JScript.

petter
Partner - Champion III
Partner - Champion III

You go to the Tools / Edit Module (CTRL+M) to get into the Macro Editor. There you need to select JScript as the Macro Language. JScript is the Microsoft JScript engine that powers all versions of Internet Explorer and is Microsofts version of Javascript.

When you have written one or more Javascript functions they will be available in the load script just as any other built-in function in QlikView. So for instance if you make a Macro that looks like this:

function myFirstJSfunc() {

     return( 123 );

};

You can go into your load script at write something like this:

LET giveMe123 = myFirstJSfunc();

Anonymous
Not applicable
Author

Yes, it works, thank you Petter!

regards Alex