Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tommyl
Creator
Creator

Using data as a grouping

Hello,

I have below "Customer Table":

SegmentCustomer ID
SME12345
SOHO

12346

SOHO12347
INDIVUDUAL12348
SOHO12349

 

And a "configuration table" like: 

Segment Name
SOHO
SME
INDIVIDUAL

 

Segment Names are alterable/ dynamic (new segment name can be added to this table). 

I need to count the customer's by segment name but in the set expression i don't want to write this hardcoded:

count(distinct(({$<segment={'SME'}>}customerid)).

I need to take the segment names(above set expression 'SME' value) from the configuration table. Is there a way to do this? 

Thank you

 

Labels (3)
1 Reply
Gysbert_Wassenaar

I think that when loading the data you should rename the field Segment to Segment Name.

But if you want to do it the complicated way you can try: count(distinct(({$<segment=P([Segment Name])>}customerid))


talk is cheap, supply exceeds demand