Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Creator III
Creator III

Re: Set analysis issue

Please see attachment

View solution in original post

11 Replies
Highlighted
Partner
Partner

Re: Set analysis issue

Can you please post the sample application and data?

Highlighted
Creator
Creator

Re: Set analysis issue

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.

Highlighted
Partner
Partner

Re: Set analysis issue

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

Highlighted
Specialist
Specialist

Re: Set analysis issue

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

Highlighted
Specialist
Specialist

Re: Set analysis issue

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

Highlighted
Not applicable

Re: Set analysis issue

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

Highlighted
Creator III
Creator III

Re: Set analysis issue

Please see attachment

View solution in original post

Highlighted
Creator
Creator

Re: Set analysis issue

Thankyou, thankyou, thankyou Anna.  This worked beautifully.


Highlighted
Creator
Creator

Re: Set analysis issue

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.