Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Saravanan_Desingh

ListBox Set Expression

I have a situation.

I have table like below. This is only sample. I have multiple entries.

  

SectorHeader
NAM
ASPACX
EMEA
LATAMX
ASPAC
EMEAX
NAMX

I have a ListBox with expression : =If(Match(Sector,'ASPAC','EMEA','NAM','MEXICO-S','DIGITAL'),Sector & '--' & Header)

This results me something like below:

 

ASPAC--X
ASPAC--
EMEA--X
EMEA--
NAM--X
NAM--
MEXICO-S--X

DIGITAL--X

The Header field has X's and NULL's.

I want to display only Header with X's.

I have tried below expression, but could not achieve any.

=If(Match(Sector,'ASPAC','EMEA','NAM','MEXICO-S','DIGITAL'),Sector & '--' & FirstSorterValue(Header,-Ord(Header)))

=If(Match(Sector,'ASPAC','EMEA','NAM','MEXICO-S','DIGITAL'),Sector & '--' & MaxString({<Header={'X'}>}Header))

Any advise please..

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Aggr(Only({1<Header = {'X'}>} Sector & '--' & Header), Sector)


Capture.PNG

View solution in original post

9 Replies
sunny_talwar

Try this:

=Aggr(Only({1<Header = {'X'}>} Sector & '--' & Header), Sector)


Capture.PNG

Saravanan_Desingh
Author

Amazing.. Sunny, The Rajini

Thank you so much.

It worked..

Saravanan_Desingh
Author

Hi Sunny,

I just changed a bit on this to list all the Values. It looks like, it returns only the Selected.

=Aggr(Only({1<Header = {'X'}>} Sector & '--' & Header), Sector)

sunny_talwar

What did you change?

Saravanan_Desingh
Author

Hi Sunny,

Added 1 to  the Expression instead of $.

sunny_talwar

Hahahaha okay... I did update that in my response when I attached the sample

Saravanan_Desingh
Author

I'm sorry. It was there in your code. As I have typed it, I could have missed that one.

Sorry again... I over looked it..

Saravanan_Desingh
Author

Oh ok sure..

sunny_talwar

No sorries my friend. I did add it at a later point. So totally not your mistake