2 Replies Latest reply: Jul 27, 2016 9:25 PM by Fei Xu RSS

    How to build a table with fix dimension using Sense Widget

    Fei Xu

      Hi community,

      1) Say in a Sense application I have a field called "City" and a measure "Sales".

      2) I want to build a table widget that has one dimension and one or many measures.

      3) I need the dimension to be hard coded to use the field "City".

      4) I need the measures to be loaded from the widget component.

       

       

      The typical html codes to build a table widget are like this:

       

      <table border="1">

      <thead>

      <tr>

        <th ng-repeat="head in data.headers">

         {{head.qFallbackTitle}}

        </th>

      </tr>

      </thead>

      <tbody>

      <tr ng-repeat="row in data.rows">

        <td ng-repeat="cell in row.cells">

         {{cell.qText}}

        </td>

      </tr>

      </tbody>

      </table>

      <div ng-if="data.rows.length === 0">

      Please add dimensions and measures.

      </div>

       

       

      This typical table widget will load all the dimensions and measures from widget components (so whatever users have defined in the front). How can I hard code the dimension to be one field meanwhile the measures are loaded as what users define? (I'll hide the dimension setting so that users can only see the measure panel).

       

      If this can be sorted out, I should be able to build a container that has many tables. These tables have same measures but the dimensions are different (I'll replace the fixed field "City" with variable). So this widget will look like a container but will be used to achieve the cycle dimension function as we have in QlikView.

       

      Thanks.

       

      Fei