Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

Only () for content of fields

Hi Folks, i have the following data-structure,

Info,         Typ,      Sales,

ABC1,      FK          100

ABC2,      FK          150

ABC3,      EK          220

ABC4,      DK          180

if i want to know the sum of  Typ = FK , so then i am using: the set expression like

Sum({<Typ ={'FK'}>}Sales) and my result does look like > Sum of FK = 250 and it does work well,

my issue is, that i have a lot of data, and i want to know the content of fields , like Info


for example: Only(Sum({<Typ ={'FK'}>}Sales)) and i want to display the fields with Info: ABC1, ABC2 but it does not work.


Does anybody have any idea, how to show the content of fields of Info on the base of fields of Typ, Sales


Thanks a lot

Beck

15 Replies
Chanty4u
MVP
MVP

try this

aggr(Only(Sum({<Typ ={'FK'}>}Sales)),info)

beck_bakytbek
Master
Master
Author

Hi Chanty,

thanks a lot for your responce, but this expresssion does not work,

i want to use such expression in listbox (Qlik Sense) like a filter.

Do you have any idea?

Thanks a lot

Beck

devarasu07
Master II
Master II

Hi,

only will return the distinct value, so try like this

only(aggr(Sum({$<Typ ={'FK'}>}Sales),Info))

Capture.JPG

for your listbox expression like this

=if(Typ='FK',Info) or

=if(aggr(Sum({$<Typ ={'FK'}>}Sales),Info),Info)

Chanty4u
MVP
MVP

if you use that exp in listbox what your getting?

beck_bakytbek
Master
Master
Author

i want to see the content like: ABC1. ABC2

jonathandienst
Partner - Champion III
Partner - Champion III

The Aggr() is redundant here (and possibly quite expensive to calculate).


Sum({<Typ ={'FK'}>} Sales) as an expression with Info as a dimension will produce the same result as the Aggr().

Please do not clutter the expressions with unnecessary operations. Test the simple operations first.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
devarasu07
Master II
Master II

hi,

pfa for qliksense sample

another way u can simple create table in sense

Dimension:

Info,

Type

Measure

Sum({$<Typ ={'FK'}>}Sales) // best approach and avid using aggr inside measure

Capture.JPG

beck_bakytbek
Master
Master
Author

Hi Devarasu,

can i use this expression in listbox like a filter, i mean, if i open the the app, then i want to see on the left-handside the litbox like a filer with contents with only: ABC1, ABC2 and if i select ABC1. then i see in the table the sum: 100

Thanks a lot

Beck

ashwinishinde
Partner - Contributor III
Partner - Contributor III

=if(Typ='FK',Info)

listbox.png