Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis in Text Object for string

Hello,

I would like to know if it is possible to use a set analysis restriction in a text object but without any expression.

In another words: usually the set analysis is made with a expression like: count, max, aggr, sum, etc and the respective restrictions.

I want to use a set analysis without the expression because I want to show a string and not a value, but I need the restrictions that a set analysis provides me.

Any thoughts?

Thank you.

Best regards.

Ivo Marques

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

=Concat({<TestArea={'ASD'},Description-={'Not valid values:'},Results-={'0'}>} Description,', ')

View solution in original post

10 Replies
MK_QSL
MVP
MVP

You can use.... FirstSortedValue in combination of Aggr and Set Analysis to achieve this..

Provide sample data.

Anonymous
Not applicable
Author

you may use max or only in combination with your string

Not applicable
Author

I have the following:

=max({<TestArea={'ASD'},Description-={'Not valid values:'},Results-={'0'}>} Description)

And the value 'Description' is a string.

This comes from a sql query and has many different strings, but with the restrictions I have the is only one string that should appear on the text object.

MK_QSL
MVP
MVP

=maxstring({<TestArea={'ASD'},Description-={'Not valid values:'},Results-={'0'}>} Description)

Not applicable
Author

This returns in fact the max string but without obeying the the restrictions.

Just the max string of the entire universe of 'Description'

MK_QSL
MVP
MVP

=Concat({<TestArea={'ASD'},Description-={'Not valid values:'},Results-={'0'}>} Description,', ')

Anonymous
Not applicable
Author

Maxstring() works with set analysis.  Something's wrong with your set.

Not applicable
Author

Yes it is.

My bad, I caught the problem with my set, but now I don't know how to fix it.

In the set can I use mid(KNR,3,1)={'7'}?

=maxstring({<TestArea={'ASD'},mid(KNR,3,1)={'7'},Description-={'Not valid values:'},Results-={'0'}>} Description)

Anonymous
Not applicable
Author

No, you can't.  It is always a field on the left side.  Maybe something like

Field = {" =mid(KNR,3,1)='7' "}

or even remove it from set:

=maxstring({<TestArea={'ASD'},Description-={'Not valid values:'},Results-={'0'}>} if(mid(KNR,3,1)=7, Description))