Skip to Main Content
Spotfire Ideas Portal
Status Future Consideration
Product Spotfire
Categories Custom Expressions
Created by Guest
Created on Oct 28, 2020

Use List Document Property in SQL "IN" Statement within Custom Expressions

It would be useful to be able to pass a list type document property (e.g. "String List", "Date List", etc...) into a SQL "IN" statement in a custom expression or calculated column. This can then be used to provide input for options for consumer users to affect data grouping, coloring, filtering, etc...

  • This is especially helpful when dealing with multiple tables in one visual.

  • This isn't covered by the use of "subsets" because you cannot use the subset in the expression to allow for something like a delta calculation between the subsets.

  • Attach files
  • Guest
    Reply
    |
    Oct 29, 2020

    I haven't tried it with a date list no, I'd imagine your solution is probably best for dates as I'm not sure how Spotfire actually stores the Date List. I've had a lot of headaches trying to work with date manipulations outside of the canned date functions...

  • Guest
    Reply
    |
    Oct 29, 2020

    Corey,

    This is correct, thank you!

    My initial test was with a date list and I was unable to get it to work.

    Is there a similar expression for the $map function to allow you to pass through date type values?

    Either way, this provides a good solution, because I can just convert the column value into a string to compare (this worked to test your suggestion).

  • Guest
    Reply
    |
    Oct 29, 2020

    I believe you can achieve this using the proper $map code. For example, a column of [NAME] with the String List property control of ${StateSelect} using this formula below will allow you to use the IN clause in a data limiting expression.

    [NAME] IN ($map("""${StateSelect}""", ","))