2017-03-14 1 views
1

enter image description hereSpotfire comment afficher une tendance dans une colonne calculted

i ont une table de données comme celui-ci. comment puis-je créer une colonne calculée pour montrer si la quantité augmente? dire si la dernière quantité est supérieure à la deuxième dernière quantité, alors le résultat devrait être vrai sinon faux. Finalement, je veux utiliser une table graphique avec une icône pour le représenter.

merci

Répondre

1

Deux réponses ici, selon si vous voulez regarder par produit ou tout simplement à l'ensemble des données dans son ensemble.

Par produit

  • Insérer une colonne calculée: Rank([Date],"asc",[Product]) as [ProductRowNumber]
  • Insérer une colonne calculée: If([Quantity]>Min([Quantity]) over (Intersect([Product],Previous([ProductRowNumber]))),"TRUE","FALSE")

produit Ignorer (du dataset)

  • Insérer une colonne calculée: Rank([Date],"asc") as [RowNumber]

  • Insérer une colonne calculée: If([Quantity]>Min([Quantity]) over (Previous([RowNumber])),"TRUE","FALSE")

Résultats

+------------+---------+----------+------------------+-------------------+-----------+-------------------------+ 
| Date | Product | Quantity | ProductRowNumber | IncreasingProduct | RowNumber | IncreasingEntireDataSet | 
+------------+---------+----------+------------------+-------------------+-----------+-------------------------+ 
| 11/01/2016 | a  |  0 |    1 |     |   1 |       | 
| 11/02/2016 | a  |  1 |    2 | TRUE    |   2 | TRUE     | 
| 11/03/2016 | a  |  2 |    3 | TRUE    |   3 | TRUE     | 
| 11/04/2016 | a  |  3 |    4 | TRUE    |   4 | TRUE     | 
| 11/05/2016 | a  |  4 |    5 | TRUE    |   5 | TRUE     | 
| 11/06/2016 | a  |  5 |    6 | TRUE    |   6 | TRUE     | 
| 11/07/2016 | a  |  6 |    7 | TRUE    |   7 | TRUE     | 
| 11/08/2016 | a  |  7 |    8 | TRUE    |   8 | TRUE     | 
| 11/09/2016 | a  |  8 |    9 | TRUE    |   9 | TRUE     | 
| 11/10/2016 | a  |  9 |    10 | TRUE    |  10 | TRUE     | 
| 11/11/2016 | a  |  10 |    11 | TRUE    |  11 | TRUE     | 
| 11/12/2016 | b  |  0 |    1 |     |  12 | FALSE     | 
| 11/13/2016 | b  |  1 |    2 | TRUE    |  13 | TRUE     | 
| 11/14/2016 | b  |  2 |    3 | TRUE    |  14 | TRUE     | 
| 11/15/2016 | b  |  3 |    4 | TRUE    |  15 | TRUE     | 
| 11/16/2016 | b  |  4 |    5 | TRUE    |  16 | TRUE     | 
| 11/17/2016 | b  |  5 |    6 | TRUE    |  17 | TRUE     | 
| 11/18/2016 | b  |  4 |    7 | FALSE    |  18 | FALSE     | 
| 11/19/2016 | b  |  3 |    8 | FALSE    |  19 | FALSE     | 
| 11/20/2016 | b  |  2 |    9 | FALSE    |  20 | FALSE     | 
| 11/21/2016 | b  |  3 |    10 | TRUE    |  21 | TRUE     | 
| 11/22/2016 | c  |  0 |    1 |     |  22 | FALSE     | 
| 11/23/2016 | c  |  1 |    2 | TRUE    |  23 | TRUE     | 
| 11/24/2016 | c  |  2 |    3 | TRUE    |  24 | TRUE     | 
| 11/25/2016 | c  |  3 |    4 | TRUE    |  25 | TRUE     | 
| 11/26/2016 | c  |  2 |    5 | FALSE    |  26 | FALSE     | 
| 11/27/2016 | c  |  1 |    6 | FALSE    |  27 | FALSE     | 
| 11/28/2016 | c  |  2 |    7 | TRUE    |  28 | TRUE     | 
| 11/29/2016 | c  |  2 |    8 | FALSE    |  29 | FALSE     | 
+------------+---------+----------+------------------+-------------------+-----------+-------------------------+ 
+0

merci ça marche! –

+0

Pas de problème @BenWang – scsimon