Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
WildmoserGeorg
Contributor III
Contributor III

values in a table that not selected with aggr and only

Hello everyone,

I would like to display values in a table that I have not selected. The following formula is used (and doesnt work)  😞 

= aggr(only{<Animal=E()>}Animal),Animal)

or

= aggr(only{<Animal=E(Animal)>}Animal),Animal)

WildmoserGeorg_0-1677599248683.png

 

What am I doing wrong? Thanks 4 help. 🙂

 

There is the Script:

Animal:
load * Inline [
ID,Animal
1,Bird
2,Cat
3,Dog
4,Fish
5,Frog
6,Turtle
];

Labels (5)
1 Solution

Accepted Solutions
Gabbar
Specialist
Specialist

A table wont show multiple rows values unless it has a dimension, If you would add ID column to the table you will get this result: (Set expression :- =only({1<Animal-=p({< >})>}Animal))

Gabbar_0-1677658255004.png

If i remove ID from the table it will show null values, 
Now if i remove Id and change only to Count in set expression it gives me this result:

Gabbar_1-1677658432405.png


So try adding Dimension to the table and also use the expression 
=only({1<Animal-=p({< >})>}Animal)

View solution in original post

8 Replies
Gabbar
Specialist
Specialist

Mistakes:
 In both expression you are using you are filtering in both the exclude expression as well as main expression.(exclude and possible are like sub-query of sql).

Try this :
= aggr(only({1<Animal=E({< >})>}Animal),Animal).
or 
= aggr(only({1<Animal-=p({< >})>}Animal),Animal)

Sometimes exclude messes up so i prefer -=p.

tresesco
MVP
MVP

One parenthesis was missing.

aggr(only({<Animal=E(Animal)>}Animal),Animal)

WildmoserGeorg
Contributor III
Contributor III
Author

Yes, you are right, I forgot the brackets in the description. In the dashboard, however, the exact syntax you described was entered and unfortunately does not work. Also thought that it would have to work exactly as you described.

WildmoserGeorg
Contributor III
Contributor III
Author

Tried both. Both as a dimension and as a measure. Unfortunately without success.

tresesco
MVP
MVP

If you are using it in a chart as dimension, don't forget to add some expression to it, otherwise you don't see them because they are by deafult supressed. 

WildmoserGeorg
Contributor III
Contributor III
Author

Thanks 4 the answers. At the moment I tried:

=aggr(only({<Animal=E(Animal)>}Animal),Animal)

= aggr(only({1<Animal-=p({< >})>}Animal),Animal)

=aggr(only({1<Animal=E({< >})>}Animal),Animal)

 

unfortunately without result so far:

WildmoserGeorg_0-1677655967459.png

 

Gabbar
Specialist
Specialist

A table wont show multiple rows values unless it has a dimension, If you would add ID column to the table you will get this result: (Set expression :- =only({1<Animal-=p({< >})>}Animal))

Gabbar_0-1677658255004.png

If i remove ID from the table it will show null values, 
Now if i remove Id and change only to Count in set expression it gives me this result:

Gabbar_1-1677658432405.png


So try adding Dimension to the table and also use the expression 
=only({1<Animal-=p({< >})>}Animal)

WildmoserGeorg
Contributor III
Contributor III
Author

@Gabbar Thx. This is the way to go. 😀