Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
mjmilian
New Contributor III

Only Function

Can the only function be used in measures and not dimensions?  Trying to get a dimension of only open(O) locations, yet when I enter in the set expression, the table comes back with invalid dimension.

Or is there a way in the load editor to combine the two tables into 1 that only shows open (O) units?

Table1:

Unit     Amount

1          10

2          5

3          7

4          9

5          10

Table2:

Unit     Open Status

1          O

2          C

3          O

4          O

5          C

Final Table Should look like

Unit     Amount

1          10

3          7

4          9

The formula I am using is:  =Only({<[Open Status]={'O'}>}[Unit Number])

Thanks,

Tags (2)
1 Solution

Accepted Solutions
balabhaskarqlik
Honored Contributor

Re: Only Function

For dimensions, you need to also use: Aggr()

=Aggr(Only({<[Open Status]={'O'}>}[Unit Number]),[Unit Number])

View solution in original post

2 Replies
balabhaskarqlik
Honored Contributor

Re: Only Function

For dimensions, you need to also use: Aggr()

=Aggr(Only({<[Open Status]={'O'}>}[Unit Number]),[Unit Number])

View solution in original post

mjmilian
New Contributor III

Re: Only Function

Thank you Bala.  Didnt understand why Only Function never worked for me until now.