Share via


Show a data set in Project Siena

 

Show a set of data in a custom gallery, where you can sort the data in ascending or descending order by a column you specify and filter the data by one or more criteria. Show a set of data in pie, column, or line chart.

In this topic, you'll download one or more compressed files and import data from each file into a collection. But you can follow the same techniques with any set of data, whether you add it from an external source, specify the data yourself, or prompt users for it.

Get a general overview of Project Siena with links to resources such as sample apps, video tutorials, and forums.

Prerequisites

  • Create your first app to understand how to perform basic tasks, such as adding a control and importing data.
  1. Download PriceList.zip, and import it into a collection named PriceList.

  2. Press Alt-V, scroll down until Galleries appears, and then click it.

    The icon you click to show a list of types of galleries

  3. Scroll down until the vertical Custom Gallery appears, and then click it.

    Icon for the vertical custom gallery

  4. Set the Items property of the gallery you just added to PriceList, and move it to the right side of the import control.

  5. Click the first item of the gallery (the gallery template), add three labels, and then set the Text property of each label to one of these expressions:

    ThisItem!Name

    Text(ThisItem!Price, "$#")

    ThisItem!Maker

    Each item in the gallery identifies the name of a product, its maker, and its price.

    A gallery template with three labels, showing product name, maker, and price

  6. Resize and arrange the labels in a row near the top of the template, and then shrink the height of the template to fit the labels more exactly.

    To select the template, click just below the labels in the first item.

  7. Shrink the height and width of the gallery itself to fit the items more exactly.

  8. (optional) Add labels over the gallery to identify each column.

    Gallery with three columns: Product name, price, and maker

Sort a set of data

  1. Follow the steps in Show data in a custom gallery, and then set the Items property of the gallery to this function:

    Sort(PriceList, Name)

    The gallery is sorted by product name in ascending order.

    A gallery with three columns, sorted alphabetically

  2. Set the Items property of the gallery to this function:

    Sort(PriceList, Name, Descending)

    The gallery is sorted by product name in descending order.

Filter a set of data

  1. Follow the steps in Show data in a custom gallery.

  2. Add a slider, name it PriceFilter, and move it over the gallery.

  3. (optional) Configure the slider so that users can't set it to a value outside the range of prices in the list:

    • Set the Min property to this function:

      Min(PriceList, Price)

    • Set the Max property to this function:

      Max(PriceList, Price)

  4. Set the Items property of the gallery to this expression:

    Filter(PriceList, Price<=PriceFilter!Value)

  5. Adjust the slider to a value that's between the highest and the lowest price in the gallery.

    As you adjust the slider, the gallery shows only those products that are no more expensive than the value you specify.

    A gallery filtered to show only items that are below a certain price

  6. Add an input-text box, and name it MakerFilter.

  7. Set the Items property of the gallery to this function:

    Filter(PriceList, Price<=PriceFilter!Value && MakerFilter!Text in Maker)

  8. Set the slider to 50, and type the letter f in the input-text box.

    The gallery shows only Fabrikam products that cost less than $50.

    A gallery in which the items are filtered by two criteria

  1. Download OEMs.zip and Devices.zip from the TechNet Gallery.

  2. Import OEMs.zip into a collection named OEMs, and import Devices.zip into a collection named Devices.

    Create your first app for an example of how to import data into a collection.

  3. Press Alt-V, scroll down until Galleries appears, and then click it.

    The icon you click to show a list of types of galleries

  4. Click the vertical Image Gallery, set its Items property to OEMs, and move it to the right of the other controls.

  5. Click the image in the first item of the gallery, and set its Image Position property to Fit.

  6. Name the gallery OEMGallery, and make it narrower to show more images.

    A narrower gallery shows more logos at once

  7. Add a horizontal Image Gallery with Text, set its Items property to Devices, and move it to the right of the OEMs gallery.

  8. (optional) Swap the data that appears in the two labels within the gallery, so that name of each device appears in larger letters above the name of the OEM.

    Left: OEM gallery, Right: Device gallery

  9. Set the Items property of the devices gallery to this function:

    Filter(Devices, 'OEM name' = OEMGallery!Selected!'OEM name')

    When you click any logo in the OEMGallery, the devices gallery shows products from only that OEM.

Show data in a chart

Your data should be structured with each series in the first row and the labels in the leftmost column, as in this example:

A collection with four columns and three rows

  1. Download ChartData.zip, and import it into a collection named ProductRevenue.

  2. Press Alt-V, click Charts, and then click Pie Chart.

  3. Set the Items property of the pie chart to ProductRevenue.

    The pie chart shows relative revenue of the products in 2012.

    A pie chart that shows revenue for three products

  4. Press Alt-V, click Charts, and then click Column Chart.

  5. Set the Items property of the column chart to ProductRevenue.

    The column chart shows revenue for each product in 2012.

    A column chart that shows revenue for three products

  6. Near the bottom of the screen, click Design if it appears, click Chart, and then set the Number of Series to 3.

    The column chart shows revenue data for each product over three years.

    A column chart that shows revenue data for three products over three years