Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
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)))

)

,CargoADescr))

Here is an example:

The original data

Screenshot_1.png

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

Screenshot_2.png

1 Solution

Accepted Solutions
Highlighted

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)

View solution in original post

6 Replies
Highlighted

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

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

Highlighted

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

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)

View solution in original post

Highlighted
Not applicable

Re: Set Analysis Condition and Selection

Thank you everyone, all your answers where very helpful.

I just add

if(GetSelectedCount(Grupo)=0

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


Thank you Kush141087

Highlighted

Re: Set Analysis Condition and Selection

I am glad that I was able to help