Using REPLACE on multi-value presentation variable, then pass on to filter IN — Oracle Analytics

Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Using REPLACE on multi-value presentation variable, then pass on to filter IN

Received Response
31
Views
4
Comments
Wolfrm
Wolfrm Rank 4 - Community Specialist

Is it possible to use string functions, like REPLACE, on presentation variables holding multiple values and then passing them on to a filter?

For example if a user uses a barcode scanner to enter product IDs into the dashboard prompt, can I use replace to add a comma between the IDs and then pass this onto the filter?

The prompt works fine if the user enters multi-values already separated with semicolons, but this isn't as quick/easy.

Answers

  • Daniel Willis
    Daniel Willis Rank 4 - Community Specialist

    You could put logic into a filter. Create a filter and then tick convert to SQL

  • Wolfrm
    Wolfrm Rank 4 - Community Specialist

    I trued this but it didn't work: "Product ID" IN (REPLACE(@{pid},'V',',V')

    Each product ID starts with a V, so this would be an easy way to add a comma before. Of course, then I'll have to figure out how to ignore the first V in the string, but one step at a time.

  • Daniel Willis
    Daniel Willis Rank 4 - Community Specialist

    Can see a missing bracket there but assume it was just lost in copy/paste. What was the error?

  • Daniel Willis
    Daniel Willis Rank 4 - Community Specialist

    You might need to put quotes around your values too. I have done something like this in the past but can't remember what/how so just throwing out ideas that may or may not work!