Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis issue

I am trying to use set analysis to work out sales as a % of total sales for a selection (region) compared to total sales (country) within a selected year by age group.
With age group as my dimension, I have used the following expresion to calculate sales for the selection -

SUM(sales)/SUM(TOTAL(sales))

I have been trying to use set analysis to compare this with sales as a % of total sales for the country.  I have used the following expression -

SUM({1}sales)/SUM({1}TOTAL sales)

Unfortnunately, the country % isnt showing the correct value.  I think it might be excluding the selction 'Year' and working out sales as a % of total sales for all years.

I would be grateful for any advice.

Thanks

Greg

1 Solution

Accepted Solutions
annafuksa1
Creator III
Creator III

Please see attachment

View solution in original post

11 Replies
manideep78
Partner - Specialist
Partner - Specialist

Can you please post the sample application and data?

Anonymous
Not applicable
Author

Sorry, I don't know how to post the sample application and data.

I have copied the straight table below -

table.png
I haven't selected a region here.  All I have selected is the year.  Therefore, the selection sales is the Scotland total.  However, I think the expression for Scotland sales is ignoring my selection and showing the sales for all years.

manideep78
Partner - Specialist
Partner - Specialist

SUM({1}sales)/SUM({1}TOTAL sales)


This expression will definitely ignore your selection. Set Identifier 1 ignores all the selection and gives result for entire data. Click on Use advance editor and attach your files

Anonymous
Not applicable
Author

have you use Year= in your set analysis in scotland sales column if yes then remove it

and can you tell me code that you used in your last two column of straight table?

anant

Anonymous
Not applicable
Author

have you use Year= in your set analysis in scotland sales column if yes then remove it

and can you tell me code that you used in your last two column of straight table?

anant

Not applicable
Author

Try to use the $ instead of the 1 in the set analysis. Then you should take the selected values into account...

annafuksa1
Creator III
Creator III

Please see attachment

Anonymous
Not applicable
Author

Thankyou, thankyou, thankyou Anna.  This worked beautifully.


Anonymous
Not applicable
Author

Hi Anna.

Sorry to bother you again.  Do you know if I can ignore other fields (in addition to region) in the following expresion.  I would like it to ignore when someone selects a college within a region too.

 

Sum( {$<region = >} Sales)  I would like it to ignore when someone selects a college within a region too.