5 Replies Latest reply: May 9, 2018 7:38 AM by Sunny Talwar

# Set analysis

Hello!,

I have a doubt with Set Analysis and iI'm going crazy, I hope you can help me !!

I have a table like below:

CountryModel20172018

España

V11003
EspañaV22845
EspañaV38057
FranciaV14568
FranciaV230026
FranciaV3254

I have Model, Year and country filters and I am trying to get a KPI using Set analysis writing a formula with dynamic filter to know the number of units in year (2017 or 2018) once I selected a country and a model in the filters. In the table are Spain, France but there are many other countries with the same models.

I've been trying with: sum ({\$ <Model = {"??"}>} [2017]).

?? My problem is that I do not want to fix the model in the formula, what I want is that every time that I choose a model using the normal filters the formula takes it to recalculate the KPI, for example let's say that I choose Model VN1 and country Spain then my KPI immediately shows me 100 (obviously for this example year 2017 would be part of the formula)

It's possible?

Kind Regards, and thank you very much

Fernando

• ###### Re: Set analysis

Are you saying that you only wish to see the KPI when Model and Country are selected?

• ###### Re: Set analysis

Hello Sunny,

actually I see the KPI always but the value of this KPI changes when I select a different Model or Country. I mean, if I select Francia and V2 then the KPI should show 300.

I´m pretty sure that my formula is wrong sum ({\$ <Model = {"??"}>} [2017]).

I wrote ?? because I don't know what i should write within the parentheses

• ###### Re: Set analysis

If you need the see the output based on your selection, then why do you need anything in set analysis? QlikView is associative and your selection will automatically be captured by the expression. Just using Sum(2017) should be enough. Have you tried that already?

• ###### Re: Set analysis

hello Sunny,

the the point is, that when ido just Sum(2017) then capture the values from v1, v2, and v3 at the same time, for my example that would be 208 (españa) instead 100.

thank yo again!!!

• ###### Re: Set analysis

But why show 100 if you have not selected anything? why not 208 or 28 or 80? You would want to show v1 when nothing is selected in Model? May be try this

If(GetSelectedCount(Model) = 0, Sum({<Model = {'V1'}>} 2017), Sum(2017))