Creating calculations using the Chatbot
As you can use the Chatbot to describe your discovery / visual using natural language, so you can use the Chatbot to describe your calculations (formulas, lists, or columns) using natural language. All you need to do is type a prompt that describes the calculation you want to create into the Chatbot in business language, and the LLM will build the calculation on your behalf.
You can create calculations in both Formulate and in Discover. In Formulate, you are creating a standalone calculation. In Discover, you are either adding an existing calculation or creating a new calculation as part of your visual creation.
New in 2025, Pyramid adds vectorization of the metric store - allowing users to easily find and reuse common metrics through NLQ requests. The automated vectorization lets the Gen-AI engines automatically find the right calculation in the customer's Pyramid repository to answer questions the user may ask with NLQ, without needing to fine tune the LLM and without loading the entire metric repository into the LLM request.
Important: Depending on the LLM you are using and the data it was trained on, it is possible to create prompts that incorporate business-specific jargon or technical information relating to highly specialized industries such as healthcare or accounting. You should be very careful that your calculations are correct and are always advised to test your calculations thoroughly.
Warning: When using LLMs, your assets are generated using public domain algorithms. This can produce erroneous and inconsistent or random results. Use at your own risk.
Before you begin
To be able to use the Chatbot to create calculations:
- Your administrator must have enabled generative AI and selected a default Chatbot LLM (not Pyramid Internal) in the Admin Console.
- You must have an Enterprise Edition license to use the Chatbot and a separate license to enable the Chatbot in Formulate.
Creating a calculation in Formulate
Step 1: Open the Chatbot
To open the Chatbot from Formulate:
- If you are not already in one of the calculation views (Formula, List, or Column), you need to open that view and select the relevant model.
- Click the Chatbot icon at the bottom right of the page, alongside the app tabs (blue arrow below).
Note: For this example, we are going to use the Chatbot to create a formula in Formulate. The steps are the same when creating a list or column, but your prompts will be different.
The Chatbot opens in an available space.
Step 2: Ask your Question
Now that the Chatbot is open, you can ask your question using one of these methods:
- Type your request into the chat's text box (purple arrow below) and click Enter. Note: As you type, you will be offered "suggestions" from other users, that you yourself have previously typed, or from the model. For more information, see Chatbot Suggestions.
- Hold down the microphone button and say your request. Release the button when you are finished. Note: You can only use the Speech-to-Text option associated with this feature if your administrator has enabled it in the Admin Console's AI Settings and you are set up as described in the "Audio Prerequisites" section of Speak to the Chatbot.
You should ask a business-centric question to build your calculation. In the following example, the question was "Build a yearly sales variance calculation for sales." Note that this question is intended to create the same formula as we created manually in Walkthrough: Yearly Sales Variance.
The Chatbot uses the underlying LLM to generate the calculation, and it responds both with the calculation and by summarizing its details in the Chatbot window. You can edit and interact with your output calculation either in the Chatbot or using the standard Formulate tools.
Tip: If you were creating this example formula, you might want to use the Format String drop-down to the right of the canvas to set the format of the calculation to match that of the Sales values.
Step 3: Use your Custom Member in a discovery
To check that your calculation is behaving as expected:
- Create a New Discovery.
- In the new discovery, add: dateKey Year, Sales and, if you didn't use Quick Discovery, your new custom member.
You can click the Quick Discovery button in the overhead ribbon to create a new discovery containing your new calculation.
Your discovery should now contain a grid with rows for each year, a Sales column, and a column for the new custom member (the variance calculation):
Tip: You might need to click the Fx button (blue arrow above) in the Measures panel to show your custom calculations / business logic in the folder tree (brown highlight). You can open those items for editing by right-clicking and selecting Open in Formulate on the context menu.
Creating or using a calculation in Discover
When you use the Chatbot in Discover, you can describe calculations that you want to include in your discoveries as part of your standard prompts. The Chatbot will attempt to do one of the following:
- If there is an existing calculation that matches the prompt, it will be used in the discovery. That means it will be added to the drop zones and canvas as if you had added it manually.
- If there is not an existing calculation that matches the prompt, it will be created and added to the discovery as a "one-off." The new calculation is added to the drop zones, canvas, and the Measures panel (brown highlight above).
Tip: You should open the calculation using the right-click Open in Formulate option and check that the formula is correct. When viewing the calculation in Formulate you can make any changes you need, and even save it as a shareable file so that your colleagues can re-use it at their leisure.
Existing calculations
When searching for an existing calculation or member to re-use, the Discover Chatbot will:
- Only search for custom measures (custom members that are measures) or custom columns.
- Match calculations by comparing their name and description to the prompt. Tip: You can use your LLM to generate Descriptions for any calculations you create on save, by clicking the Pyramid button in the Save dialog.
- Find suitable calculations from those you have access to; this means, any public calculation you have permissions to see, your private calculations, and any one-off calculations in the current discovery.
New calculations
When creating a new calculation on-the-fly, the Discover Chatbot will create the new calculation as a "one-off" that is embedded in the discovery.
Note: This new calculation behaves like any other one-off calculation created by any other method. It is shareable, can be opened in formulate on the right-click, and so on.
Related information
In addition to the features that were explicitly used when creating a calculation in Formulate, you should also make full use of the common features of the Chatbot. These include "type ahead" and automated suggestions, playing and replaying the audio, copying your prompts, and so on.
- Click here for details of the Chatbot functions