Can I define a label for certain filter values

JeRoen shared this question 10 days ago
Awaiting Reply

Hello,

Is it possible to use the custom query option in a filter to define some sort of label to show in the filter. So I want to filter on a number but show a label. This label is in a different table. I can easily create a query with gives the number and the label (description) but the measure table has the number in it and not the label.

I thought I read somewhere that this is possible but I get an error that the query should result in a single field.

/40ce297fe0d52e15a03401f5464072d1

Maybe the names should be something specific.

I tried finding the article or forum post where I read that this was possible so now I am unsure if it is.

Please let me know.

Regards,

JeRoen

Comments (2)

photo
1

Hi There

I have done something similar to what you require by using Reference Codes

in YF 8 you can refresh Reference Codes with a SQL Query that returns the Code, the Description (Label) and if required the Sort Order

You can then use that Reference Code in your Filter Group in the View to Select using the Code but Display the Description (label) and if required have a specific Sort Order

photo
1

Hi JeRoen,


Thank you for your question!


As Mark has mentioned, you might be able to achieve the desired results by using a Reference Code. Once you have set up a Reference Code from the Admin Console, you can add it to a field in your View. An example might be mapping Country ISOCodes to the Country Name.


When you bring the field into a report, it will automatically default to the mapped value, however depending on your requirements, you may want to change the values back to the original data type, i.e. if you are using Reference Codes such as "Low", "Medium" and "High", changing the column format back to Text (or even having two instances of that column, one with the metric, one with the Reference value) so that you can understand the underlying metric.


When bringing the field in as a filter, it will show the user an easy to understand, Referenced value.


/74d575f00210f1390e3639e7cc802fc3

/5368536a324ccb41be07139539b09ffa

/e7bd10968aee7833ead3377e5102be6e


Let me know if this helps you reach your desired outcome! Custom queries within filters to show a label is not something that is supported when building reports.


Regards,

Simon