Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
ganderson100
Creator
Creator

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
Partner

Can you please post the sample application and data?

ganderson100
Creator
Creator
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
Partner

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

anantmaxx
Specialist
Specialist

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

anantmaxx
Specialist
Specialist

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

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

View solution in original post

ganderson100
Creator
Creator
Author

Thankyou, thankyou, thankyou Anna.  This worked beautifully.


ganderson100
Creator
Creator
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.