Spotfire - Cross Table - spotfire

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.

Related

Excel RANGE VLOOKUP

STUDENT TIME SCORE WANT
JOHN 1 68 146
JOHN 2 78 146
JOHN 3 77 146
JOHN 4 91 146
JOHN 5 96 146
JAMES 1 66 119
JAMES 2 53 119
JAMES 3 80 119
JAMES 4 96 119
JAMES 5 50 119
JAMES 6 94 119
I have data COLUMNS 'STUDENT' AND 'TIME' AND 'SCORE' and wish to create 'WANT' and the rule which for I will need VLOOKUP is this: WANT = the sum of the SCORE values at TIMES 1 and 2, so I WISH TO USE VLOOKUP to find the 'SCORE' values for each 'STUDENT' at TIMES 1 and 2 and take the sum.
You can try SUMIFS() in this way.
=SUM(SUMIFS($C$2:$C$12,$B$2:$B$12,{1,2},$A$2:$A$12,A2))
It may need to array entry for older versions of excel. Array entry by CTRL+SHIFT+ENTER.
Assuming your dataset is ordered by "student name" (with unique student names), then "time", you could use :
Classical way, in F2 :
=IF(AND(B2=1,B3=2,A2=A3),C2+C3,IF(AND(B2=2,B1=1,A2=A1),C2+C1,OFFSET($F$1,MATCH(A2,A$2:A2,0),0)))
Greedy way (Office365 needed), in E2 :
=SUM(FILTER($A$2:$C$12;($B$2:$B$12<=2)*($A$2:$A$12=A2)))-3
Reference :

How can I convert a repeated column element in to a title row?

I have some rather ugly post-pivot data, much like the following:
Location
Team
Staff
Sales
North
1
1100
55
North
2
2100
56
North
3
3200
91
South
1
7100
75
South
2
3100
16
South
3
9200
41
East
1
8100
25
East
2
9100
56
East
3
4200
31
My users don't like the duplication in the first column and would rather it be a header row with only one element, with the three resulting tables side-by-side. So, something like this:
with the obvious extension for East.
How can I achieve this automatically? I would do it by hand, but the real version of my table has a few hundred categories of values in the Location column.

Find out minimum value of specific columns in a row in MS Excel

My table in Excel looks something like this:
abcd 67 94 52 89 24
efgh 23 45 93 54 34
ijkl 64 83 23 45 92
mnop 34 45 10 66 53
This is a student database containing marks obtained in various subjects. I need to calculate the percentage in each row such that out of 5 subjects, the first subject is always included with other 3 subject with maximum marks.
Example: abcd 67 94 52 89 24 75.5%
Here 75.5%=(67+94+52+89)/4=302/4=75.5 where 24 being the lowest has been excluded and 67 has to be taken even if it were the least.
What I require is the least(excluding the first column, of course) of all the columns in that particular row, so that I can sum all the marks and subtract this least marks and finally use it to calculate the percentage.
Any help/suggestion would be appreciated. Thank You.
You'll need to adjust this for your columns, but if you sum the entire range, then subtract the min value after, do a count of the range then subtract one from that, you will be able to get the average.
This code is using the 4 values from column B through F and the 4 values are: 67 94 52 89 24... which results in 75.5
=(SUM(B3:F3)-MIN(C3:F3))/(COUNT(B3:F3)-1)

Extract a value from the chart, filtered by criteria in excel

I've got two sheets like this in excel :
Price chart :
**Post AB** **Post Tenn** **Post DN**
Price 10.1-10.20 Price 10.1-10.20 Price 10.1-20.1
CityOrigin Destination 20 kg 40 kg 20 kg 40 kg 20 kg 40 kg
New York Madrid 45 40 40 50 45 40
Los Angeles Madrid 65 70 70 70 56 60
Oregon Paris 89 100 110 105 74 98
Washington Paris 34 80 45 65 45 69
and Working chart:
Price Rate
Post Career CityOrigin Date 20KG 40KG
Post AB New Tork =Today() ? ?
Post Tenn Los Angles " ? ?
Post DN Oregon " ? ?
I am wondering, is it possible to use today date with Post Career and City origin to extract only rates that are actually valid for today for 20kg and 40kg packages from price chart sheet?
My ideal result should be look like this :
Price Rate
Post Career CityOrigin Date 20KG 40KG
Post AB New York 10/20 40 45
Post Tenn Los Angles 10/20 70 70
Post DN Oregon 10/20 74 98
My question is which function I should use to call the price based on date and post career from price sheet? multiple Lookup??
So here is what I have so far without knowing how other date ranges will be like in your data structure, but this should give you something to work on.
The formula I entered in cell D13 is:
=INDEX($C$4:$H$7,MATCH($B13,$A$4:$A$7,0),MATCH($A13,$C$1:$H$1,0)+IF(D$12="20 kg",0,1))
Basically I just use INDEX/MATCH to lookup the row and column numbers. Once you have other data come in to play, I can take another look if you can't find a way around it.
Please note that I have removed the * sign on row 1 so it is easier to do in the MATCH function, otherwise, you will need to use array formula to do this and that is probably not the way you want to go.

MS Excel: how can I make Max() more efficient?

I have a set of data that looks like this:
ID Value MaxByID
0 32 80
0 80 80
0 4 80
0 68 80
0 6 80
1 32 68
1 54 68
1 56 68
1 68 68
1 44 68
2 54 92
2 52 92
2 92 92
4 68 68
4 52 68
5 74 74
5 22 74
6 52 94
6 52 94
6 46 94
6 94 94
6 56 94
6 14 94
I am using {=MAX(IF(A$2:A$100=A2,B$2:B$100))} to calculate the MaxByID column. However, the dataset has >100k rows, with mostly unique IDs: this seems to be a really inefficient way to do this, as each cell in C:C has to iterate through every cell in A:A.
The ID field is numeric and can be sorted- is there a way of more intelligently finding the MaxByID?
You may be able to use a pivot table to find the maximum for each unique ID: see this link for an example.
Once you have that table, VLOOKUP should enable you to quickly find MaxByID for each ID.
Once you have sorted by ID you could add columns to get the start row number and count for each unique. These 2 numbers allow you to calculate the size and position of the range of Unique values. So then you can use MAX(OFFSET(StartValueCell,StartThisUnique-1,0,CountThisUnique,1)) to get the max
This might be faster
{=IF(A2=A1,C1,MAX(($A$2:$A$24=A2)*($B$2:$B$24)))}
Since your data appears to be sorted, you could see if the ID matches the row above and simply copy the max down.

Resources