Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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 (2)
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