Document toolboxDocument toolbox

Creating MDX expressions using Kyvos Copilot

Creating calculated measures or members on top of your base metrics from data sources is one of the key aspects of designing any semantic model. Kyvos enables you to use MDX language for creating calculated measures is MDX. While MDX is a powerful language, it may not be easy for many designers and business users to write calculations using MDX. To provide assistance to designers and users, Kyvos comes with a feature named Ask Kyvos Copilot.

This GenAI-driven service assists semantic model and report designers by generating MDX calculations based on natural language descriptions. All you need to do is provide natural language input to generate an MDX query. It enhances the overall user experience by facilitating the creation of calculations, offering a quick start for users unfamiliar with the MDX language, and enabling experienced users to generate skeletons for complex calculations.

Important points before using Ask Kyvos Copilot

  1. To enable the Ask Kyvos Copilot option, configure the GenAI connection through Kyvos Manager. See the section for more details.

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

  3. 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.

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

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.