Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
brucejensen
Contributor III
Contributor III

Conditionally hide bullet point in text object

I have a text object with concatenated fields, each preceded by a bullet point chr(8226). Sometimes the fields are empty, which is fine but I'd like the bullet point to be hidden too if that is the case. Is there a way to do this.

Currently it looks like this: Fieldname1&chr(13)&chr(8226)&Fieldname2

which produces:

  • Contents of Fieldname1
  • Contents of Fieldname2

But if Fieldname2 is empty it currently looks like this:

  • Contents of Fieldname1

I'd like to have that emply bullet hidden. Is there an easy way to do this in set analysis?

Thanks.

1 Solution

Accepted Solutions
Anonymous
Not applicable

you can use a if condition - something like below:

=if(Fieldname1<>'',chr(8226)&Fieldname1)&chr(13)&if(Fieldname2<>'',chr(8226)&Fieldname2)

View solution in original post

3 Replies
Anonymous
Not applicable

you can use a if condition - something like below:

=if(Fieldname1<>'',chr(8226)&Fieldname1)&chr(13)&if(Fieldname2<>'',chr(8226)&Fieldname2)

brucejensen
Contributor III
Contributor III
Author

That worked! Thanks!

aveeeeeee7en
Specialist III
Specialist III

Hi Bruce

Use this in your script:

Load *,

if(Len(Trim(Field2))>0,NewField,Replace(NewField,chr(8226),'')) AS FinalField;

Load *, Field1&chr(13)&chr(8226)&Field2 as NewField Inline [

Field1, Field2,

IN, INDIA

AUS, AUSTRALIA

USA,

CAN, CANADA

];

Also, see the Attachment.

Regards

Aviral Nag