Qlik Community

Qlik GeoAnalytics Discussions

Discussion Board for collaboration regarding Qlik GeoAnalytics.

naeemhaq
New Contributor

Expression based Dynamic Symbols

Hello fellow members.

I am working on a map bubble layer and I want to select dynamic images/symbols based on Event IDs. I also want to limit the points i.e. only show points that match the criteria. Below is my expression.

if(event_id = 38, 'https://upload.wikimedia.org/wikipedia/commons/3/3e/Rightblackarrow40.svg'

or event_id = 20020, 'https://upload.wikimedia.org/wikipedia/commons/3/30/Downredarrow40.svg')

Problem is that only condition after ‘or’ is returning the right symbol/image but the first one is returning blue dot (i.e. no image/blank dot). I did a lot of googling but no luck.

Please suggest if there is a clever way of doing this because I have about 10 event IDs with 10 different symbols. I also have to somehow put it in a legend.

I would really appreciate your help.

thanks

4 Replies
Employee
Employee

Re: Expression based Dynamic Symbols

Hi Naeem,

Should work, just make sure that the expression evaluates to a string with the url. Test with a table with the same dim and meas.

An inline table would also work, then just use icon_url as the epxression.

load * inline [

event_id, icon_url

38, 'https://upload.wikimedia.org/wikipedia/commons/3/3e/Rightblackarrow40.svg'

20020, 'https://upload.wikimedia.org/wikipedia/commons/3/30/Downredarrow40.svg'

];

Thanks,

Patric

naeemhaq
New Contributor

Re: Expression based Dynamic Symbols

Hi Patric,

thanks alot for your answer and sorry for my newbie questions. would it be possible for you to elaborate further on "expression evaluates to a string with the url". 

Here is what I am trying:

Qlik Sense version Nov 17, below is my Load Script in the Symbol Expression window of a Bubble Layer.

LoadScript.png

But I am getting below error and could not fix the syntax. Do you know what I am doing wrong.

ScriptError.png

MVP
MVP

Re: Expression based Dynamic Symbols

I suggest that you remove the redundant quotes from the url and put the closing bracket and semi-colon onto a new line.

Employee
Employee

Re: Expression based Dynamic Symbols

Hi Naeem,

If you use "load * inline", that goes into to your load script.

Your expression should probably look like this:

=if(event_id = 38, 'https://upload.wikimedia.org/wikipedia/commons/3/3e/Rightblackarrow40.svg',

if(event_id = 20020, 'https://upload.wikimedia.org/wikipedia/commons/3/30/Downredarrow40.svg'))

Thanks,

Patric

Community Browser