简体   繁体   中英

Spotfire - Cross Table

在此处输入图片说明 I have a case where I have 2 rows which has the same data. They look as duplicates but actually they are not.

Now I wanted them to show up in Cross table which means I need to have my two records present in the viz. In my value axis I have unique concatenate function used.

Do we have any way to show up those two records in cross table?

This can be achieved in a data table but just wanted to know if this can be achieved through a Cross Table.

Thank you beforehand for the clarification!

First things first, I would like to point out that both records are technically in your cross table, you just can't distinguish between them. If you do a Count(), which is a Row Count, it will match the number of records in your detail table.

Assuming you actually DO want to be distinguishing between your identical records in the Cross table, this CAN be done, though I can't think of a good example where it should be. A cross table is meant to be showing you aggregations, rather than individual rows of data, and having so many columns across the top feels cluttered and odd.

Disclaimer aside, what you need to do is add a calculated column giving you a RowNumber. The Expression for this will be similar to one of the following:

1: Rank("IrrelevantString","ties.method=first")

2: Rank("IrrelevantString","ties.method=first",[Country],[Number],[Name])

The first method above will give each row a different value, essentially adding an identity column to your data set. This gives you something like this

Country   Number  Name     Rule    RN
Spain     42      Voltes   69     1
Spain     42      Voltes   69     2
Spain     42      Voltes   70     3
France    42      Voltes   69     4
France    42      Voltes   69     5
Spain     41      Voltes   69     6
Spain     42      XXX      69     7

The second method will allow you to see whether you are looking at a unique row or a duplicate; if you are familiar with SQL, this is your "partition by" segment. If you're not familiar, what it's essentially doing is splitting the data by the columns listed, and giving a row number to everything in that data set.

So if you had

Country   Number  Name     Rule
Spain     42      Voltes   69
Spain     42      Voltes   69
Spain     42      Voltes   70
France    42      Voltes   69
France    42      Voltes   69
Spain     41      Voltes   69
Spain     42      XXX      69

Your RowNumber Column would be

Country   Number  Name     Rule   RN
Spain     42      Voltes   69     1
Spain     42      Voltes   69     2
Spain     42      Voltes   70     3
France    42      Voltes   69     1
France    42      Voltes   69     2 
Spain     41      Voltes   69     1
Spain     42      XXX      69     1

This RowNumber can then be added as a Column/Row grouping in your Cross Table and VOILA, for whatever bizarre reason, you are showing every distinct row in your data set separately.

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