Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis expression using a variable

Hi

I want to write a set analysis expression to calculate total sales where [REGION]  is equal to either ‘Africa’, ‘Asia’ or ‘Ireland’

where my total sales amount is a variable called $vSumSales.

Thanks in advance

7 Replies
sunny_talwar

May be this:

=Sum({<REGION = {'Africa', 'Asia', 'Ireland'}>}Sales)

Anonymous
Not applicable
Author

Hi,

Try this:


=Sum({<REGION = {'Africa', 'Asia', 'Ireland'}>}Sales)

Kushal_Chawda

try,

=Sum({<REGION = {'Africa', 'Asia', 'Ireland'}>}Sales)

Not applicable
Author

Thanks guys - they were all the correct answer and I realised what I was doing it wrong.

Moving on from this what if for the same view I now wanted sales broken down by the regions mentioned rather than aggregated ? Ie total sales for Africa, Asia and Ireland each

sunny_talwar

Create a chart with REGION as dimension and the =Sum({<REGION = {'Africa', 'Asia', 'Ireland'}>}Sales) as expression.

Not applicable
Author

Thanks Sunny - that was glaring me in the face. I think I was trying to take a very difficult route.

sunny_talwar

No problem

I am glad we were all able to help you here.