Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Like in qlikview, one value dimension "in" another

Hi,

I have two dimensions, for example dimension1 and dimension2, also value for example price.


I have to sum(price) where dimension1 is like dimension2, both value are similar. I would like to sum only this price where $(dimension1)=$(*dimension2*). So the text value of dimension2 is inside value of dimension1.

Is it posible ? If yes please help me with expression.

Thanks
Sylwester

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

The earlier posting is the right trackright:

=if(wildmatch(dimension1, '*' & dimension2 & '*'), sum(price))


Please dont waste time trying out set expressions. They cannot be used for a row by row comparison as they are only evaluated once for the table.


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

9 Replies
maleksafa
Specialist
Specialist

try using wildmatch


if (wildmatch($(dimension1), $(*dimension2*)) >=1 , sum(price))

PrashantSangle

Hi,

Use indirect set analysis

P() will help you.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

The expression gives me "-" value.

Not applicable
Author

Hi Sylwester,

Use if condition in Expression.

PFA. Hope this will help You.

Regards,

Joshmi

Not applicable
Author

Something like this?

sum( {$<[dimension1] = P({1<[dimension1]={$(*dimension2*)}>})>}price)

Not applicable
Author

It is not so easy, the dimensions are not equal, can be only similar, like

Green factory US and Green factory


Sylwester

Not applicable
Author

Hi Sylwester,

I would do a wildmatch comparison between the two fields in the script and create a new field from that, flagging those which are 'similar'. You can then use the new field in your set analysis

hope that helps

Joe

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

The earlier posting is the right trackright:

=if(wildmatch(dimension1, '*' & dimension2 & '*'), sum(price))


Please dont waste time trying out set expressions. They cannot be used for a row by row comparison as they are only evaluated once for the table.


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi,

Please try the below code

=Sum(if(FindOneOf(Dim1,Dim2)>0,Price))

Reagrds,

Joshmi