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: 
richard_chilvers
Specialist
Specialist

Concat()

I have a table of products and each product has one or more features.

Product  Feature

Car 1      Red

Car 1      4dr

Car 1       Leather seats

Car 2       5dr

Car 2        Red

etc.....you get the idea.

I have a table which shows each product, with all its features in a single column using the CONCAT function:

eg.    Car 1       Red; 4dr; Leatherseats

This works well. Except, if I SELECT a Feature (eg. Red), I (correctly) see all products which are Red, but I don't see their other features.

Is there a way I can show all Features for all Products which have the SELECTed Feature ?

Thanks

1 Solution

Accepted Solutions
sgrice
Partner - Creator II
Partner - Creator II


It could be simpler

Concat({1<Model = p ({$})>} Feature,',')

This will select all rows for where the Models exists in the list of models in the current selection. But will ignore all other selection.

View solution in original post

9 Replies
MK_QSL
MVP
MVP

Create Straight Table


Dimension

Product

Expression

Concat(Distinct Feature,'; ')

ramoncova06
Specialist III
Specialist III

if I understood right, if you select on red,you want to know what are the features for each red car, right ?

Concat({1<Model =p ({<Feature = {$(=Concat(DISTINCT chr(39)&Feature&chr(39),','))} >} Model)>}Feature,',')
richard_chilvers
Specialist
Specialist
Author

Ramon

Thanks very much. This works, although I am still trying to understand the set analysis logic here !

sgrice
Partner - Creator II
Partner - Creator II


It could be simpler

Concat({1<Model = p ({$})>} Feature,',')

This will select all rows for where the Models exists in the list of models in the current selection. But will ignore all other selection.

richard_chilvers
Specialist
Specialist
Author

Yes, Steven, that works and is even neater !

Thanks

timanshu
Creator III
Creator III

Hi Ramon Covarrubias  RamonCova06

Can you please tell me is the below expression works fine for this case.??

And in which cases it can deviate from result compared with your expression .??

Concat({1 <Product = {$(=concat( Distinct chr(39)&Product&chr(39),','))} >} distinct Feature,',')

here Product is same as model.

Thanks in Advance

Timanshu

ramoncova06
Specialist III
Specialist III

it does not give you the same output because you want to match feature to feature and then get the Products that are availables for it, in your example you are comparing Product to Feature, though they would never match

timanshu
Creator III
Creator III

Hi Ramon,

I checked my Expression. I think it works fine in this case. I am not comparing product to feature. I just wrote expression to filter only possible Products in addition to consider all feature values.

You can check this expression and if you could differ the two expressions then it would be very nice.

richard_chilvers
Specialist
Specialist
Author

Hi Ramon

Your expression and Timanshu's both work for my requirement. I simply want to select the products (eg. red cars) and then show all features for these products. You expression may work for a more complicated requirement too.

Thanks to you both.