cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
HSS
HSS
Level IV

How to put only one value label in graph, if labels are repeated.

Hello,

I have a data set and I want to label my graph with respect to vales in a column. But the labelled column has repeated entries, is there any way to pick only first/last value of the label or any single unique value ?

In my attached data, I want to plot 'LOC_X', 'LOC_Y' and want to Label it with 'Area Code'. But in this data, there are 5 same values of 'Area Code' for 5 different sets of X, Y. And this creates a mess! Not sure if there is any solution for it.

 

In the alternate way, I have 'map boundaries' map installed but I do not know how to put 'Area Code' in it and if I use label option, I am ending up at the same place.


Any help here ?

1 ACCEPTED SOLUTION

Accepted Solutions
Georg
Level VII

Re: How to put only one value label in graph, if labels are repeated.

Dear @HSS ,

you can label the first value, and unlabel the others by the attached script.

 

For Each Row(
	Row State( Row() ) = If( Col Rank( :Area Code, :Area Code ) == 1,
		Labeled State( 1 ),
		Labeled State( 0 )
	)
);
Georg

View solution in original post

4 REPLIES 4
jthi
Super User

Re: How to put only one value label in graph, if labels are repeated.

I'm not too familiar with this sort of coordinated data, but maybe you could calculate some sort of value based on LOC_X and LOC_Y and Area Code:

 

If(
	:LOC_X + :LOC_Y == Col Max(:LOC_X + :LOC_Y, :Area Code), :Area Code,
	Empty(), .
)

Select Missing values based on this and unlabel them

 

jthi_0-1614178081983.png

jthi_1-1614178089203.png

 

 

-Jarmo
HSS
HSS
Level IV

Re: How to put only one value label in graph, if labels are repeated.

Hi Jthi,

Thanks for for the reply. Yes, this is one solution. And I am also doing along this line only.

Many thanks again for your response.

Georg
Level VII

Re: How to put only one value label in graph, if labels are repeated.

Dear @HSS ,

you can label the first value, and unlabel the others by the attached script.

 

For Each Row(
	Row State( Row() ) = If( Col Rank( :Area Code, :Area Code ) == 1,
		Labeled State( 1 ),
		Labeled State( 0 )
	)
);
Georg
HSS
HSS
Level IV

Re: How to put only one value label in graph, if labels are repeated.

Thanks George.
I guess this is better/right way of doing it.

Thanks again for help.