Skip to main content

Data storytelling - create a story


Data storytelling - create a story

Note: SDK support for data storytelling is deprecated and may be removed in a future release. As an alternative, use the generic methods of the engine API and the AbstractStructure class methods to define the relevant properties.

With data storytelling you can create a presentation based on the data in your app. You can take snapshots of selected visualizations and use them in your narrative together with text, shapes, and effects. You create slides and design the story with your particular audience in mind. In your narrative you focus on key elements and create a convincing story to make your message clear.

An additional, useful feature of data storytelling is that you can easily switch between a snapshot in the presentation and its context in the app. In the app context, you can make new selections and continue the analysis from where you left off in the presentation. After the analysis, you can resume the presentation.

This data storytelling example illustrates how you can create a Qlik Sense story using the Qlik Sense .NET SDK.

We recommend that you download and run the appropriate example before you continuing reading. The sample code for the data storytelling example is available on GitHub.

Note: The purpose of the sample code provided by Qlik is to demonstrate capabilities and use cases of the API. They are provided on an as-is basis, without any guarantees that they will work in all system configurations and future software releases. These code samples are released under: Wikipedia: MIT license.

Take a snapshot

Before you create your story you must take a snapshot. To take a snapshot, do the following:

  1. Connect to Qlik Sense Desktop.

    For more information, see Getting started with the Qlik Sense .NET SDK.

  2. Go to the Dashboard sheet and get Sales per Region on the sheet.

    var sheet = app.GetSheets().FirstOrDefault(sheet => sheet.MetaAttributes.Title.ToLower() == title.ToLower());
    //Locate "Sales per Region" by comparing the title
    foreach (var cell in sheet.Cells)
    	var child = sheet.GetChild(cell.Name);
    	if (child.GetLayout().As<VisualizationBaseLayout>().().Title == title)
    		salesPerRegion = child;
  3. Take a snapshot.

    // Take a snapshot of SalesPerRegion
    if (salesPerRegion != null)
    	app.CreateSnapshot("SDK_SalesPerRegion", sheet.Id, salesPerRegion.Id);	

Create a story

You can now create a short and simple story, where the focus is on creating a few slides with snapshots and titles. Do the following:

  1. Create a new story and enter a title.

    // 1 Create a new story
    var storyProps = new StoryProperties();
    // 2 Enter the title
    storyProps.MetaDef.Title = "SDK Created - Three largest regions";
    var story = app.CreateStory("ThreelargestregionsStory", storyProps);				
  2. Create a slide.

    var slideProps = new SlideProperties();
    var slide1 = story.CreateSlide("ThreelargestregionsSlide", slideProps);		
  3. Take snapshots and add them to the slide.

    Locate “Top 5 Customers” by comparing the title
    foreach (var cell in sheet.Cells)
    	var child = sheet.GetChild(cell.Name);
    	if (child.GetLayout().As<VisualizationBaseLayout>().Title == title)
    		salesPerRegion = child;

The story is complete.

Data storytelling

API reference