Document toolboxDocument toolbox

Using Kyvos Copilot for creating MDX calculations and querying

Designing any semantic model involves creating MDX-calculated measures or members and querying data sources using base metrics. Although MDX is a powerful language, it may be challenging for designers and business users to write calculations and perform querying with it.

To assist designers and users, Kyvos has a feature called Ask Kyvos Copilot that allows for the creation of MDX expressions for calculated measures and querying using the MDX language.

The Ask Kyvos Copilot feature, powered by GenAI, generates MDX calculations and queries from natural language descriptions to assist report designers. All you need to do is provide natural language input to generate an MDX query. Facilitating the creation of calculations and querying, it offers a quick start for users unfamiliar with MDX language while enabling experienced users to generate skeletons for complex calculations, thereby enhancing their productivity.

Important points before using Ask Kyvos Copilot

  1. To use the Ask Kyvos Copilot feature for creating MDX calculations or queries, you need to configure the GenAI connection via Kyvos Manager. See the GenAI Configuration section for more details.
    On the GenAI Configuration page, you can specify whether you want to use the feature for MDX calculations or MDX queries. If you want to create expressions for calculated measures or members, select MDX calculations. If you want to query on the semantic model, choose the MDX queries option. However:

    • If you select the MDX calculations option, the Ask Kyvos Copilot option will appear in the Calculated Measures dialog box for creating expressions for calculated measures and members.

    • If you select MDX queries, the Ask Kyvos Copilot option will appear in the Query Playground page.

  2. The Ask Kyvos Copilot dialog box displays the Show Input or History tab.

    • Sample Input: It is a natural language text samples used for generating MDX calculations or queries. The sample inputs will be displayed for all sematic models even if the sematic model is used for the first time.

    • History: It displays previously accepted interaction with the current semantic model. If you change the semantic model, the history will also be changed accordingly.

  3. To get the appropriate MDX expression, you must understand the purpose of calculation in the natural language (English).

  4. In case you get an inaccurate MDX expression, we recommend you modify the input in natural language and regenerate the output to get the correct MDX expression.

  5. The MDX expression will be auto-corrected by validating the name and syntax of dimensions and measures against the semantic model. 

  6. From Kyvos 2024.9 onwards, if you select a suspended semantic model, an error message will be displayed.

Creating expression using Kyvos Copilot

You can create MDX expressions for calculated measures in semantical model and Kyvos worksheets using the Kyvos Copilot. For this, perform the following steps.

The steps mentioned here provide guidance on how to use the Kyvos Copilot feature on the Kyvos worksheets. You can use the same steps to create calculated measures on the semantical model.

  1. From the Toolbox, select  Workbooks, then select a workbook and worksheet.

  2. Use the Design workspace.

  3. On the right side of the window, click Action menu (...), and then select Calculated Measures.

    image-20240226-161141.png
  4. Click the Ask Kyvos Copilot link. The Calculations using Kyvos Copilot dialog is displayed.

    KyvosCopilot-1.png
  5. On the Calculations using Kyvos Copilot dialog, do the following:

    1. Category: Select the required type of category for calculations, such as General Calculations, Arithmetic Calculations, or Time-series Calculations.

    2. Input Prompt: Type your inputs to generate MDX expression in the natural language (English).
      NOTE: It is recommended to read important information about the usage of Input Prompt by clicking the Help icon.

      By default, the Sample Input section on the right of the dialog box displays sample inputs for the selected category type.

    3. From the Sample Input section, you can use the following:

      • Use Me: Hover over the sample input shows the Use me option. Clicking the Use me option, automatically copies the selected sample in the Input Prompt box. You can make adjustments or use them directly.

      • Copy to Clipboard: You can also copy the sample input using the Copy to Clipboard option. This will copy in the input to the clipboard for future use.

    4. History: The history of the last 30 days is stored and can be filtered by category or custom text. You can also reuse previous inputs and outputs to create new expressions. To create new expressions, users can reuse previous inputs and outputs automatically by clicking the Use me option. Alternatively, they can manually fill the input by clicking the Copy to Clipboard option and paste into the Input Prompt box to regenerate the output.

      • Search: Use this option to search for the required input.

      • Copy All: Use this option to copy all the previously used input prompts.

        For example, you can copy the data and paste it into Notepad. After that, you can modify the input key as needed. The updated input can then be used to generate new output. Additionally, you can view the history of each input saved in JSON format along with its corresponding generated output.

  6. Click Generate. The MDX output is then generated accordingly.

  7. Click Accept. The MDX expression is displayed in the Calculated Measures dialog box.

  8. Click Apply. The calculated measure is created and you can use this for your analysis.

Note

To modify the generated output, you can use the Copy Generated Output option located in the Calculations using Kyvos Copilot dialog box. This will allow you to copy the output and modify it according to your requirements. Once you have made the necessary changes, you can then copy the updated output in the Calculated Measures dialog box.

 

Copyright Kyvos, Inc. All rights reserved.