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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sum with a variable

hi, so I created a variable in settings and now I want to use this variable when summing up things.

Variable: Turnover

trade_price*traded_amount

Expression:

sum(If(IsNull(sub_exec_broker),Turnover))

17 Replies
Not applicable
Author

sum(If(IsNull(sub_exec_broker),$(Turnover)))

its_anandrjs
Champion III
Champion III

Try with

sum(If(IsNull(sub_exec_broker), $( Turnover ) ))

Regards

Anand

florentina_doga
Partner - Creator III
Partner - Creator III

try this

sum(If(IsNull(sub_exec_broker),$(Turnover)))

its_anandrjs
Champion III
Champion III

Update:- When create the variable Turnover do not use = sign above the fields

Ex:-

Let Turnover = 'trade_price*traded_amount';

And expression will be =sum( $(Turnover) )

Regards,

Anand

Not applicable
Author

Not Working. Should I change anything to the defintiion of the variable?

Not applicable
Author

Sorry doesnt give me anything

Not applicable
Author

Doesnt sum i jsut get 0 as value

its_anandrjs
Champion III
Champion III

Create variable like

Let Turnover = 'trade_price*traded_amount';

Your Expression:-

sum( If ( IsNull( sub_exec_broker ) = -1, $(Turnover) ) )

Hope this works

Regards

Anand

Not applicable
Author

I appreciate your effort, but it doesnt work I get 0 as value I have made the LET step and use your expression.