How to find the difference between two selected minimum and maximum values.

How to find the difference between two selected minimum and maximum values.

book

Article ID: KB0081880

calendar_today

Updated On:

Products Versions
Spotfire Analyst All supported versions

Description

This is an example of selecting a two date value and finding the affiliated integer values and then taking the two integer values and finding the difference between them.

Issue/Introduction

This is an example on how to select a two dates. Then find the difference of the affiliated values from the dates.

Resolution

Create a text area to be able to select a minimum date and a maximum date, setting a document property. You also need to find the max and min values for each date. The two expressions used are:

MinValue:    Min([Weight]) over ([Mfg Date])
MaxValue:   Max([Weight]) over ([Mfg Date])

Then create a column to only show the value per the dates selected:

SelectedMin:   If(DocumentProperty("MinDate")=[Mfg Date],[MinValue])
SelectedMax:   If(DocumentProperty("MaxDate")=[Mfg Date],[MaxValue])

Create a column to show the difference between the two selected dates:

Diff:  Max([SelectedMax]) - Min([SelectedMin])
 

Please see the attached DXP file as an example.

Attachments

How to find the difference between two selected minimum and maximum values. get_app