Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
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 (1)
1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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