Creating vocabularies
Vocabulary enables you to add terms for Insight Advisor. These can be used to server as synonyms for fields and values not present in the data or define custom analysis. Vocabulary does not require you to have a custom logical model.
With vocabularies, you can define synonyms and custom analysis. With synonyms, you can add terms to define values or selections of values from your data model. With custom analyses, you can define the response from custom questions or partial questions and indicate the specific results returned by Insight Advisor.
Why create vocabularies?
Vocabulary is a key tool for preparing your app for natural language queries. Insight Advisor attempts to link all natural language queries to field names and values in your data. It cannot know all possible search terms that your app users might enter. Vocabulary lets you fill these terminology gaps, linking terms to fields and field values.
For example, in the tutorial app, you have some products that are swimwear. These items are in the category Beachwear in the data. In Sheet, if you search for swimwear, you will not get any results. Similarly, you cannot search for footwear and get results for both men's and women's footwear.
Custom analyses are useful when you know what analyses you want your app consumers to receive based on their search terms. For example, you know that your app users have a preference to viewing regional data as maps. You can use a custom analysis to make sure that maps are offered when users include regional in their searches.
Creating beachwear vocabulary
Do the following:
-
From Prepare, click Vocabulary.
-
In Synonyms, click Create terms.
-
In Terms, enter the following terms:
-
swimwear
-
swimsuits
-
-
Under Applies to, select CategoryName.
-
Under Condition, select In.
-
Under In, select the following values:
-
Beachwear
-
-
Click Create.
Creating footwear vocabulary
Do the following:
-
In Synonyms, click Create terms.
-
In Terms, enterfootwear.
-
Under Applies to, select CategoryName.
-
Under Condition, select In.
-
Under In, select the following values:
- men's footwear
-
women's footwear
-
Click Create.
Creating regional custom analysis
For this custom analysis, you will not specify a measure. This will allow Insight Advisor to pick a measure based on how the someone uses regional in their query.
Do the following:
-
Click Custom analysis.
-
Click Create terms.
-
Under Terms, enter regional.
-
Under Analysis, select Breakdown (Geospatial).
-
In Data, under Geographicals, select Country.
-
Click Chart.
-
Under Chart type, select Map.
-
Click Create.
Results
Navigate to Sheet. Search for what is the average freight for footwear. You now receive results for both men's and women's footwear.
Next, search for gross profit for swimwear in 2019. You now get results for beachwear while searching with swimwear.
Now, search for show me regional sales. You now get a map distribution of the sales by country.
Thank you!
Now you have finished this tutorial, and hopefully you have gained some more knowledge about business logic and Insight Advisor in Qlik Sense.