Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
wizardo
Creator III
Creator III

SET analysis? allowing only selection in ONE field (company) to effect the chrt

hi there,

i did a little research before i posted this question but couldnt find an answer.

im sure it is becouse i missed it and not becouse it doesnt exists:) but anyway i need your help

i want to (i think) use set analysis to allow only selection made in one field(company) to effect the chart

so if the user selects a country or customer it wouldnt change the chart 's data but if he selects 2008 then he will see all sales per that year

ps

i already know(well its simple lol) how to get the opposite, that is: to allow selection in ALL field and lock (or partialy lock) the selection in only ONE field.

might this be part of the solution?

plz plz help

Mansyno (aka wizardo)

11 Replies
Not applicable

Hi Mansyno,

Sum({<Region={Europe, NorthAmerica}, Month=>} Amount)

The region "Europe" and "NorthAmerica" are fix in this example. All selections are possible except selections in field "Month"

Good luck!

Rainer

wizardo
Creator III
Creator III
Author

Hi Rainer,

thank you for your answer

what i require is the OPOSITE of that

i have a field company i want selections made on this field to show in the graph and all the other selections DISREAGRDED.

as if the user only selection was on the company field.

to explain it using your example:

i want that any selections the user makes on the Region field, to effect the graph.

and all other selection (IE Month) to be disregarded

hope i explaoined myself 🙂

thanks again

Mansyno

Not applicable

In Set Analysis, you can ignore all selections by preceding the set declaration with a 1. i.e.

Sum( {1<Company = {'ABC Tech'}>} Field)


That would disregard everything, including selections on Company. In order to disregard all selections except Company, I would try something like:

Sum( {1<Company = {$(vSel)}>} Field)


EDIT: I was having some problems getting this expression to work. I changed the dollar sign expansion to be a variable instead. The variable description would need to be: =GetFieldSelections(Company)

wizardo
Creator III
Creator III
Author

hi there NMiller,

thank you for the reply.

i see what your trying to do here and it seems to be the right way

but i guess my set analysis expression capebilities seems to lack the know how

i tried implementing your solution buti could NOT get it to work.

I probably misplaced a comma or an equal sign, but what ever i did i didn't get any results (either i got null or 0)

do you think you could put this expression in a working Sample?. or show me the corect syntax?

BTW i tried both using the variable and without

Not applicable

Here is a file. I have two dimension fields: Company and Product.

I created a Straight Table that uses both of those dimensions. There are two expressions, one without Set Analysis and one with. As you make selections in the two dimension fields, you can see that the Table is filtered based on the Company selection, but ignores the Product selection. By looking at the non-Set Analysis expression, you can see which fields would have been filtered had you not been using this Set Analysis expression.

Does that make sense?

wizardo
Creator III
Creator III
Author

hi there

thnks for taking up the time to help.

i could see where i made the mistake and used your code to guide me.

but there is still one problem left, and its the problem of what hapns when there is no selction at all in the company field

well what hapns is that it get zero

and it should have get all of the lines for all of the companies

so it needs some fixing i think. its no use if not complete

thanks so much again

Mansyno

Not applicable

Use this for the variable definition: =If(IsNull(GetFieldSelections(Company)), '*', GetFieldSelections(Company))

Not applicable

A bit late to reply on this, but seems many are looking for a correct answer.. and of course.. it is simple..

=sum(
{1< // Disregards all selections with 1
Year=P(Year), // Using element function P() to select the Possible values for Year (this will work with Null(), 1 and many values selected in the field)
Quarter=P(Quarter), // etc...
Month=P(Month)
>}
Amount // Whatever you wanna measure
)



Not applicable

I have never heard of this P() function. I tried it and it didn't work plus there is nothing in the help text about this. Is this in a newer version of qlikview?