Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

LIKE $(dollar-sign variable) Help

Hi,

It's a quick and simple one today:

Sum(IF(Comp_Competitor like $(CompetitorName) & '*', Comp_MediaSpend))

How can I write this so qlikview will understand?

Example variable value is "Tesco"

Example working expression is:

Sum(IF(Comp_Competitor like 'Tesco*', Comp_MediaSpend))

Could someone help me convert the above working expression to replace 'Tesco*' with a variable I've specified in the load script?

Many thanks,

James.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

=Sum(IF(WildMatch(Comp_Competitor, $(CompetitorName) & '*'), Comp_MediaSpend))

View solution in original post

5 Replies
tresesco
MVP
MVP

=Sum(IF(WildMatch(Comp_Competitor, $(CompetitorName) & '*'), Comp_MediaSpend))

Not applicable
Author

Sum(IF(Wildmatch(Comp_Competitor,'Tesco*'),Comp_MediaSpend)

something like the above should work

Edit damn u tresco u too fast this early in the morning!!!

tresesco
MVP
MVP

And, if you don't include single qoutes in variable declaration, you might have to do it here like:

=Sum(IF(WildMatch(Comp_Competitor, '$(CompetitorName)' & '*'), Comp_MediaSpend))

Note the quates around variable expansion.

Not applicable
Author

Marked as helpful simply for the speed

Cheers bud,

James.

Not applicable
Author

Hi jwaller,

example for you with if and with set analysis.

regards

Darek