Case study
As a data analyst, you use Halo Reports to discover insights and produce reports based on the available data sources. You are, however, not in control of the datasets themselves - they may be either delivered by an external agency or be distributed internally, but without the possibility to impact the list or content of available variables. The datasets include a lot of information on both your products and your customers. You are using this information to define product and customer segments that are the basis of your analysis. Since the specific company-approved definitions can change frequently, and the definitions themselves are often complex and based on multiple variables, you are looking for a way to prepare the segment definitions in a way that will allow easy reuse and adjustments.
User-Defined Questions (UDQs)
Halo Reports allows report authors to define their own custom questions based on the available variables. While simple recoding only allows remapping question-answer labels within one variable, UDQs provide an option to define a new variable based on multiple input variables.
One of the available ways to define a new UDQ is to manually define conditions for each response to be available in the new variable.

If we want to define customer segments based on demographic variables, we simply define conditions and labels for each segment that should be available. The conditions can be defined using available questions using the same logical syntax as in the query filters.

Depending on whether the definitions can or cannot overlap, we may decide to create the UDQ as a single or multiple response question type. A “TEST” button in the UDQ creator allows you to verify if the definition is correct (e.g., if there are no overlaps for what should be a single response question) and what the respondent counts would be for the responses defined in this new question.

Once created, the UDQ is permanently stored in the context of your user for the study in which it was created. This allows you to reuse it in multiple reports. If a change of definitions is needed in the future, you can update it in the UDQ editor, and the change will be automatically applied in all the reports that use this custom question. You can also decide to share the question with other users in your organization by going to the context menu of the newly created question and selecting “Manage access” there.

You can make it available for others as read-only or give them full access rights and allow them to modify it within their accounts. Note that even if you don’t share the UDQ but share the report that uses the UDQ, the definition of the custom question will still be made available to others in the context of this report, so that they get the same results as you do. In such a scenario, however, the users won’t see this UDQ on the list of available questions if they create their own reports.
UDQs from Expressions
In some scenarios, specifying each response manually can be cumbersome. There may be a lot of options, or they may change frequently. In case the expected “translation” logic is consistent, using Halo Reports expressions to define the new question may come in handy.

Expressions provide you with a set of text, mathematical, and logical functions that allow you to define the question without going response by response. This also allows for some more complex definitions, not possible to achieve with a manual filtering of conditions.
See below some examples where using the expressions to define UDQ could be helpful:
The datasets in your study have a different structure across countries or years. There may be different questions that need to be used to get certain information, which by default does not make it possible to aggregate or easily trend results coming from different sources. You can use an IfElse block to define one question that will use values from different variables depending on the country or year.

There are several multiple-choice questions that you want to analyze together (i.e., you are interested in whether a specific answer appears in any of them). In such a case, you can combine the answers from all questions into one new multiple-choice question.

For each respondent, you are interested in a specific mathematical function based on their replies to the numeric questions. For example, you may be interested in the combined average satisfaction index.

Automatically change labels within one question using a standard rule. For example, extract the brand name from model names that include the brand name as the first word, or extract the year from questions that include a longer label that starts with the year information.

Note that it is also possible to use expressions to define a single response in the “define responses and conditions” workflow.
