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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

User-defined functions inside load script

Hi, Is this possible in QlikView?  I'd like to define a function that does some simple math

define addTheseForMe(int a, int b):

     return a+b;

MyTable:

LOAD if(ColA = x AND colB = y, addTheseForMe(ColA,ColY),null())

RESIDENT some_table;

Labels (1)
1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

You can do:

SET addTheseForMe = $1 + $2;

MyTable:

LOAD if(ColA = x AND colB = y, $(addTheseForMe(ColA,ColY)),null()) 

RESIDENT some_table;

Regards,

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

1 Reply
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

You can do:

SET addTheseForMe = $1 + $2;

MyTable:

LOAD if(ColA = x AND colB = y, $(addTheseForMe(ColA,ColY)),null()) 

RESIDENT some_table;

Regards,

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!