Skip to main content
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to use variable in set analysis

Hi all

i m going to use the set analysis for calculating sum(sales) based on the company

vcomp=getfieldselections(Company)

in set analysis,i want to use this variable as

=sum({$<Company={(vComp)}>}Sales)

its not give the output

how to use this..

could anyone help me..

thanks in advance

10 Replies
llauses243
Creator III
Creator III

Hi,

Always $( var ) then test as ... =sum({$<Company={$(vComp)}>}Sales) or =sum({<Company={$(vComp)}>}Sales)

good luck , Luis

Not applicable
Author

Hi,

Try this


=Sum({<Company = {$(vComp)}>} Sales)


Not applicable
Author

Hi

that one also not working ya...

send me one sample example using company and sales....

here vcomp contains the list of selected companies with comma separator..

could you pls help me...

thanks in advance

Not applicable
Author

Hi

yea,its work fine...

only when the comapny name like xxxx,yyyy

but its not work for xxxx Ltd,yyyy ltd....

when i pass the company name directly like xxxx Ltd and yyyy ltd its not working fine

so i pass the name as within the [xxxx Ltd],[yyyy ltd] braces,it will return the value...

how to do this one in the variable

Not applicable
Author

HI,

Please see attached file.

I used variable vComp in expression. The value of vComp is seperated by comma.

Hope this one helps

Nadsky

Not applicable
Author

Hi,

I update my file. This now solves your problem with Company Name having more than one word. I use trigger event on saving company names to variable vComp

Regards

Not applicable
Author

hi

thank you very much....

its working fine...

really its good...

Not applicable
Author

I'm glad that I was able to help you.

Please mark the post as "Verified Answer" so that other members with the same problem might know which part of discussion sovles the issue.

Thanks and Good Luck!

Not applicable
Author

hi...

now i m going to use the expression as

(sum(depreciation)*sum(profit)/sum(income))/sum(depreciation)

how to use this expression in the set analysis.....

could you pls help me

thanks in advance