Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
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

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda
MVP
MVP

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
sunny_talwar
MVP
MVP

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

Kushal_Chawda
MVP
MVP

try this,

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

Likewise you can do for others

sunny_talwar
MVP
MVP

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

Kushal_Chawda
MVP
MVP

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)

Not applicable
Author

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

Kushal_Chawda
MVP
MVP

I am glad that I was able to help