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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
xxxx2
Contributor II
Contributor II

Use a table to filter but keep all lines in the table

Hello,

 

I have a table with two dimensions and a calculated expression, and I would like to use this table to filter data on other graphs. 

I would like this table to keep all lines when filtering. Is it possible ?

 

This is what my table look like :

xxxx2_1-1741014844451.png

 

But when I select something :

xxxx2_2-1741014862715.png

I would like other graphs to be filtered but this table to stay the same as when no "Client" and no "Recap" are selected (just those 2, I have other selected fields that I want to keep).

 

Dimensions :

- Client

- =if(Recap = 'LAY' or Recap = 'ENF'
, Recap
)

 

Expression :

= Aggr(
sum( IF(
 
IF(((Sais / Sais_Soc) -1) < £Ecart_Sais, 1, 0)
+
IF(((An / An_Soc) -1) > £Ecart_An, 1, 0)
+
IF(((QtFin / Cons) -1) > £Ecart_Cons, 1, 0)
= 3
, 1
, 0
)
)
, Client, Recap
)
 
 
 
Thanks for your help
 
Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

You may need a manipulating of the selection state within each aggregation part, like:

sum({ Set } aggr({ Set } sum({ Set } Expr), Dim1, Dim2))

View solution in original post

10 Replies
diegozecchini
Specialist
Specialist

Hi!
try to change this:

= Aggr(
sum( {< Client=, Recap= >} IF(

IF(((Sais / Sais_Soc) -1) < £Ecart_Sais, 1, 0)
+
IF(((An / An_Soc) -1) > £Ecart_An, 1, 0)
+
IF(((QtFin / Cons) -1) > £Ecart_Cons, 1, 0)
= 3
, 1
, 0
)
),
Client, Recap
)


{< Client=, Recap= >} tells Qlik to ignore selections on Client and Recap, keeping all rows in the table.

xxxx2
Contributor II
Contributor II
Author

Hello, thank you for your answer.

 

I changed the expression but lines still disappear in the table when selecting : 

xxxx2_0-1741074544265.png

 

Expression :

= Aggr(
sum( {< CdClient = , Recap = >}
 
IF(
 
IF(((Sais / Sais_Soc) -1) < £Ecart_Sais, 1, 0)
+
IF(((An / An_Soc) -1) > £Ecart_An, 1, 0)
+
IF(((QtFin / Cons) -1) > £Ecart_Cons, 1, 0)
= 3
, 1
, 0
)
)
, CdClient, Recap
)
 
 
 
 

I would like it to stay like the first picture...

 

marcus_sommer

You may need a manipulating of the selection state within each aggregation part, like:

sum({ Set } aggr({ Set } sum({ Set } Expr), Dim1, Dim2))

xxxx2
Contributor II
Contributor II
Author

@marcus_sommer 

It seems to work perfectly thank you ! 

Do you have an explanation of why I need to sum the whole previsous expression ?

 

Expression :

= Sum ({< CdClient = , Recap = >}
Aggr( {< CdClient = , Recap = >}
sum( {< CdClient = , Recap = >}
 
IF(
 
IF(((Sais / Sais_Soc) -1) < £Ecart_Sais, 1, 0)
+
IF(((An / An_Soc) -1) > £Ecart_An, 1, 0)
+
IF(((QtFin / Cons) -1) > £Ecart_Cons, 1, 0)
= 3
, 1
, 0
)
)
, CdClient, Recap
)
)
 
 
 
 
Padma123
Creator
Creator

use this expression

sum({1}Aggr(
sum( IF(
 
IF(((Sais / Sais_Soc) -1) < £Ecart_Sais, 1, 0)
+
IF(((An / An_Soc) -1) > £Ecart_An, 1, 0)
+
IF(((QtFin / Cons) -1) > £Ecart_Cons, 1, 0)
= 3
, 1
, 0
)
)
, Client, Recap
)
 
)
marcus_sommer

Applying something like: aggr(sum(Expr), Dim) is not an expression else it creates a calculated dimension. Only if the aggr() is wrapped with any aggregation-function like sum/count/concat() it becomes an expression again.

In many cases the aggr() output could be adjusted by using: aggr(NODISTINCT sum(Expr), Dim) but logically it remains a calculated dimension and depending on the data-model/data-set and the object-dimensionalities the results may not always be like expected.

 

xxxx2
Contributor II
Contributor II
Author

Thank you for your answer.

It keeps all the lines but the expression is not evaluated for the non selected ones.

xxxx2
Contributor II
Contributor II
Author

Ok thank you

 

And I need to put the {set} within each aggregation part otherwise each aggregation will be evaluated separately ? Not with the {set} of the upper one ?

marcus_sommer

No, each aggregation-part will respect the defined respectively implicit selection state. Means without specifying anything it acts against the default state and therefore it's often necessary to define the wanted selection state everywhere - and it must not be always the same else any existing alternate state might be referred and/or in any way be adjusted.