Jump to content

For Map Chart, How to show one marker for each 10 mins of its DateTime constraint


CHUN KIT LEE

Recommended Posts

I think the main part is to calculate the marker.

 

From this answer you can get the date binned to the nearest 10 minutes

https://community.spotfire.com/questions/how-bin-minute

 

So [date_bin10] is calculated as:

Time(Hour([date]),Integer(Integer(Minute([date]) / 10) * 10),0,0)

 

Then you calculate the distance between the original [date] and the binned date [date_bin10]

[distance_to_bin] calculated as:

Abs(DateDiff('second',[date],[date_bin10]))

 

Then you calculate the marker when the distance is at its minimum for every value of the binned date.

Marked calculated as:

case when [distance_to_bin]=Min([distance_to_bin]) over ([date_bin10]) then String([date_bin10]) end

 

In the Map Chart you can then set the labels to Marked (since it wants an aggregation, you can use e.g. First(Marked))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...