First class support for hyperlinks

Hi,

I’d like to request first class support for hyperlinks (similar to Looker).

Currently we can render the link via the HTML option but this has some weird side effects.

  1. The filter looks strange
  2. We have to store the HTML is our Redshift tables rather than applying it at visualization
  3. Queries are suboptimal when using cross-filter (see image below) as they can’t leverage sort keys (or primary keys)


Thanks!

Hi @olammas,

We haven’t supported the link option like Looker. But I think I have a workaround to solve the 3 side effects that you’re facing:

  1. Instead of storing the HTML column in the database, I can create a custom dimension to dynamically generate the HTML

For example: in my model, I have this dimension email, I want to create a mailto link based on this email value

dimension email {
  ...
}
  
dimension link_test {
  label: "Link Test"
  type: "text"
  definition: @sql '<a href="mailto:' || {{ email }} || '">Mailto: ' || {{ email }} || '</a>'
  ;;
}

Explanation: this is SQL string concatenation, in Postgres the operator is ||. The {{ email }} is the AML syntax to refer the dimension email

  1. When building the report for this link_test column, I choose to format it as HTML so it can display as a link

  1. When building the filter, I use the original email column instead of the HTML column
    This makes the filter value looks nicer

Let me know if my suggestion helps you

1 Like

Thanks @HuyVu . This does really work for our needs as we only want to show only the string and the link in one cell rather than duplicating valuable space in the table

3 Likes

Hi @olammas

I’m sorry I’ve overlooked your reply here. Regarding your concern about:

as we only want to show only the string and the link in one cell rather than duplicating valuable space in the table

We can overcome this by:

  • Only show the HTML column in the chart (Pic 1)
  • But filter the value based on the original email column (Pic 2)

Let me know if this works for you

Sorry for the typo!!!

No that doesn’t work. If the user wants to cross filter it will still apply the cross filter on the HTML rather than the primary key. My image attached is when using a cross filter (see point 3 in the OP)

Hi @olammas,

Got your point.

Right now I can’t think of any workarounds to solve all 3 points.
Let me get back to my team to design a proper solution on this. I’ll keep you updated with the progress

1 Like

Also noting that users have flagged the current implementation means you cannot copy what is in the cell. You end up copying the HTML to your clipboard, which is not ideal

1 Like