Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

richard_chilver
Contributor III

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

Tags (2)
1 Solution

Accepted Solutions
sgrice
Contributor II

Re: Concat()


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.

9 Replies

Re: Concat()

Create Straight Table


Dimension

Product

Expression

Concat(Distinct Feature,'; ')

ramoncova06
Valued Contributor III

Re: Concat()

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_chilver
Contributor III

Re: Concat()

Ramon

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

sgrice
Contributor II

Re: Concat()


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_chilver
Contributor III

Re: Concat()

Yes, Steven, that works and is even neater !

Thanks

timanshu
Contributor III

Re: Concat()

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
Valued Contributor III

Re: Concat()

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

Highlighted
timanshu
Contributor III

Re: Concat()

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_chilver
Contributor III

Re: Concat()

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.