# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Certification Exam Sale - 40% off. Register by June 30, 2020. GET DETAILS
Highlighted
Not applicable

## Set Analysis Condition and Selection

Hello There!

Is it possible to have a condition in Set Analysis and exclude the results when selecting dimension declared in set analysis?

=Sum(Aggr(

if(sum(Aggr(Sum ({<TipoDato={'NS_TipoServicio'}, Año={'\$(vMaxAño)'}, Grupo={'Habitacional'} >}CanAliHue) ,CargoADescr))=0,0,

( sum(Aggr(Sum ({<TipoDato={'Movimiento'}, Año={'\$(vMaxAño)'}, Grupo={'Habitacional'} >}CostoMov) ,CargoADescr ))

/

sum(Aggr(Sum ({<TipoDato={'NS_TipoServicio'}, Año={'\$(vMaxAño)'}, Grupo={'Habitacional'} >}CanAliHue) ,CargoADescr)))

)

Here is an example:

The original data

When I do a selection for dimension "Grupo" should be as the next image:

1 Solution

Accepted Solutions
Highlighted
MVP

## Re: Set Analysis Condition and Selection

try this

Expression for Habitacional

If(Wildmatch(GetFieldSelections(Grupo), '*Habitacional*') , YourExpression, 0)

Expression for Barco

If(Wildmatch(GetFieldSelections(Grupo), '*Barco*') , YourExpression, 0)

Expression for Construccion

If(Wildmatch(GetFieldSelections(Grupo), '*Construccion*') , YourExpression, 0)

6 Replies
Highlighted
MVP

## Re: Set Analysis Condition and Selection

You may do this:

Expression for Habitacional

If(GetFieldSelections(Grupo) = 'Barco' or GetFieldSelections(Grupo) = 'Construction', 0, YourCurrentExpression)

Similar ideas for other two expression

HTH

Best,

Sunny

Highlighted
MVP

## Re: Set Analysis Condition and Selection

try this,

if( getfieldselections(Grupo)='Barcos', Your Expression, 0) for Bracos Text object

Likewise you can do for others

MVP

## Re: Set Analysis Condition and Selection

Use this, as this should be a much better solution

Expression for Habitacional

If(SubStringCount(Concat(Grupo, ','), 'Habitacional') = 1, YourExpression, 0)

If(SubStringCount(Concat(DISTINCT Grupo, ','), 'Habitacional') = 1, YourExpression, 0)

Expression for Barco

If(SubStringCount(Concat(Grupo, ','), 'Barco') = 1, YourExpression, 0)

If(SubStringCount(Concat(DISTINCT Grupo, ','), 'Barco') = 1, YourExpression, 0)

Expression for Construccion

If(SubStringCount(Concat(Grupo, ','), 'Construccion') = 1, YourExpression, 0)

If(SubStringCount(Concat(DISTINCT Grupo, ','), 'Construccion') = 1, YourExpression, 0)

HTH

Best,

Sunny

Highlighted
MVP

## Re: Set Analysis Condition and Selection

try this

Expression for Habitacional

If(Wildmatch(GetFieldSelections(Grupo), '*Habitacional*') , YourExpression, 0)

Expression for Barco

If(Wildmatch(GetFieldSelections(Grupo), '*Barco*') , YourExpression, 0)

Expression for Construccion

If(Wildmatch(GetFieldSelections(Grupo), '*Construccion*') , YourExpression, 0)

Highlighted
Not applicable

## Re: Set Analysis Condition and Selection

if(GetSelectedCount(Grupo)=0

At the beggining of expession when there is no selection, WILDMATCH function works perfect for me.

Thank you Kush141087

Highlighted
MVP

## Re: Set Analysis Condition and Selection

I am glad that I was able to help