简体   繁体   中英

How to show the top 10 column values in Spotfire

I need to show top 10 values using Spotfire. I googled lot but I could not find the best solution.

I followed this tutorial: Creating a Dynamic Top Ten Chart but did not find success.

How can I do this?

How to limit a visualization by the top 10 values:

There are 2 ways you could do this. I will list them both with pros/cons.

Method 1 - Visualization Level

  1. Open your visualization's properties and go to the Data tab.
  2. Select "Edit..." under "Limit data using expression:" and include the following expression: Rank([values],"desc")<11 where [values] is the numeric column you want the top 10 of.

Example below. Note all of the filters are untouched on the right. 可视化级别过滤

Method 2 - Analysis Level

  1. Insert a calculated column with the following expression: Rank([values],"desc") .
  2. Use the built in filters to only include Rank 1-10 for the top 10. This will filter all of your visualizations in your given filtering scheme to just the top 10.

Example below. Note the RANK filter on the right and how I have it narrowed down to a max of 10. 分析级别过滤

Let me know if you are still having issues.

Edit: Right click and open image in a new tab if you are having trouble seeing the content of my screenshots. The source imgur link should have the larger resolution viewable.

Within the Properties > Show/Hide Items , you can add a rule to show only the top 5 or 10 items by the Value Axis.

在此输入图像描述

To do a Top 10 Report in Tableau.

Approach 1:(Query level)

Using custom sql : Edit your custom sql to something like this.

select top 10 * from table order by Id desc

Approach 2:(Report level)

Using Index

1.Create a calculated field. `Index()`
2.Change it to discrete.
3.Drag it to column shelves(It should be the first column)
4.Change it to continuous drag it to filters shelves and select `1-10`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM