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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

adding user defined function

hello..

i want to  reare a user defined fucntions..so that user can use it.

Say for example : Top 5 is my user defined function..so the code required to calculate it will be already written..

so when user uses top5 we need to just pass aametre like based on what we need top5.can anyone suggest.

I tried for simle sum..it didnt work.

What i did is i created a variable v_sum  assigned as sum(@1)

in the chart i used  =v_sum (salary) but it is not considering it as function.I trie done more option as =$(v_sum (salary))

even this didnt work.

Regards,

Prajna

1 Solution

Accepted Solutions
tresesco
Champion III
Champion III

Define v_sum like:        Sum($1)          

Then call it like:           $(v_sum(AmountField))

View solution in original post

4 Replies
tresesco
Champion III
Champion III

Define v_sum like:        Sum($1)          

Then call it like:           $(v_sum(AmountField))

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

define v_sum as sum($1) instead. The $1 is the parameter. The expression using the variable would be: $(v_sum(salary))


talk is cheap, supply exceeds demand
Not applicable
Author

oh..okay

I had added @ instead of $

Thanks & Regards

Prajna

Not applicable
Author

How do you define a sum?