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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable in set analysis

I have created a variable

vSL =sum(AP_IN_CALLS_HNDLD) + sum(AP_IN_CALLS_ABAND) +sum(AP_ROUTED_OUT_CALLS) + sum(AP_TRANS_AP_CALLS_HNDLD) +sum(AP_OVRFLW_IN_CALLS_HNDLD) + sum(AP_CALL_OVRFLW_OUT) -sum(AP_CALLS_HELD)+sum(ServCalls)) /
(
sum(AP_IN_CALLS_HNDLD) + sum(AP_IN_CALLS_ABAND) +sum(AP_ROUTED_OUT_CALLS) + sum(AP_TRANS_AP_CALLS_HNDLD) +sum(AP_OVRFLW_IN_CALLS_HNDLD) + sum(AP_CALL_OVRFLW_OUT)+sum([Answered+Transfered])+sum(Abandoned))

and would like to use it in a set analysis for each region but this does not work.

=sum({$<Region={'Thompson'}$(vSL))

Please assist

Labels (1)
4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

The problem is that you cannot write Sum( ... Sum(...)) and this is what you have done!

You should include the region (declared as a variable) in each sum ...

santhosh_k_n
Creator II
Creator II

Hi Mamorex,

Please assign the variable to which field its pointing,

eg:

V_state = ABCD then use it as below

=sum({$<Region={'Thompson'}, State ={'$(V_State)'})


hope this helps...

tresB
Champion III
Champion III

Try like this:

vSL = '(AP_IN_CALLS_HNDLD+ .....) / ( ......) '

vPart1= 'Sum({<Region={'&chr(39)


I.e. Take the fields without Sum() in variable declaration and now in the expression try like:

=$(=vPart1&'Thompson'&chr(39)&'}>}'&$(vSL)&')' )

Not applicable
Author

What the error message are you getting?

use if...

if(Region='Thompson', $(vSL))

hope this help!

Regards

Vinay