Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
khouloudgh
Contributor
Contributor

how can i create a custom function with specific parameter

how can i create a function that have in her parameter a specifiq numbere that i will use in my sql statement 

my_function( int a )

sql select  * from my table where  shamp = a }

endFuction 

this my principe any help 

3 Replies
Mauritz_SA
Partner
Partner

khouloudgh
Contributor
Contributor
Author

i need to call my function in the editor expression to charge only the variable i need 

Mauritz_SA
Partner
Partner

So do you mean in the front end (because then you can't use SQL)? What exactly would you like to do?

You can create a variable as well if you want to and pass it a parameter. For example:

In script:

Set CustomFunction = $1*2;

Or in front end:

Create variable called CustomFunction2 with value $1*3

Then $(CustomFunction(3)) will return 6. $(CustomFunction2(3)) will retun 9.