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

Use of ONLY Function

Hi all,

Somewhere i read the use of ONLY function with AGGR function.

"Conveniently, it is also an aggregation expression, allowing you to use set analysis in some cases where you otherwise wouldn't be able to."

Can anybody explain the above staement and give some useful uses of the ONLY function? I know the basics of what it returns, so no need to explain the basics.

Thanks.

15 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Juho

If you want help with this issue, I suggest that you start a new thread with your question. This thread is answered and you are unlikely to get help here.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable

Thanks Jonathan, I moved my question here: http://community.qlik.com/thread/86889

Not applicable

Hi John

I find this thread really useful, i managed to get some idea from your post about below:

That should return 10,20,30. But what if, again, you wanted to restrict it to only Type X?

concat(aggr(only({<Type={'X'}>} Value),ID),',')

However, i use the type X as date formatted as YYYY-MM-DD. I'm tyring to display the data from last 10 days.

So i have the following data:

ActDate               Suppgroup      Value

2014-06-01          A                    10

2014-06-01          B                    15

2014-06-02          A                    20

2014-06-02          B                    25

2014-06-03          A                    30

2014-06-03          B                    35

2014-06-04          A                    40

2014-06-04          B                    45

So if today's date is 2014-05-04 and i want to display the information for date equal to 2014-06-02

my formula is       =concat(aggr(only({$<[actdate]={">=$(=today()-3)"}>}Value),suppgroup),',')

the output Im expecting is

Suppgroup          Value

A                         20

B                         25

I'm not getting the correct output.

aparnanair1405
Contributor II
Contributor II

Hi John,

This helped me as well.

had to work on it a bit to fit my requirements, but got it right

concat(aggr(if(rank(-aggr(min(Score),CQ_Agent,Parameter),1,1)=1,Parameter),CQ_Agent,Parameter),', ')

Thanks,

ARN

Not applicable

Can Anybody Explain the use of "Only function" at the time of Loading data ?

for e.g.

LOAD

Only([Entry Type]) as Entry Type,

[Posting Date]

From Value_Entry.qvd(qvd);

tresesco
MVP
MVP
Author

It would load a [Entry Type] value only if it has a single value. Otherwise, the field would load nothing.