Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vijetas42
Specialist
Specialist

Min max values

Hi Team,

I have data like,

 

DATEValue
20151030-3.3
20151106-3.2
20151113-3.2
20151120-3.1
20151127-3.1

from this data i want to show min, max value in textboxes and also date associated to them.If two different date ave same value then it should show recent date.

Regards,

Vijeta

5 Replies
Anonymous
Not applicable

I made a short sample with your data in an Inline table (I get string for values)

In TextBox i give Expression (in your case you should use max/min for values as they will be numbers)

='Val ' & MaxString(Value) & ' Date ' & max({<Value={'$(=MaxString(Value))'}>}DATE)
&
chr(10)
& 'Val ' &
MinString(Value) & ' Date ' & max({<Value={'$(=MinString(Value))'}>}DATE)

vishsaggi
Champion III
Champion III

Another way is

= 'Date: ' & Max(Aggr(Firstsortedvalue(DATE, Value), DATE)) & ' Val: ' &Max(Aggr(Firstsortedvalue(Value, -Value), DATE)) & Chr(13)&

  'Date: ' & Min(Aggr(Firstsortedvalue(DATE, -Value), DATE)) & ' Val: ' &Min(Aggr(Firstsortedvalue(Value, -Value), DATE))

Capture.PNG

vijetas42
Specialist
Specialist
Author

my dates will be varying, if i select particular date then it takes last 8 weeks date and their values and if i try with your expression like,

=max(Aggr(Firstsortedvalue({<DATE={">=$(vPrior8WeekDate)<=$(vCurrentDate)"},NAME={'ALP'}>}VALUE,-VALUE),DATE))

but, it's giving some wrong value same case with min it's giving same as returning for max that too both are incorrect.

vishsaggi
Champion III
Champion III

Can you share some sample data you are trying this will be easy to test and work on. Based on the sample provided we gave you the option, quite did not get this date range can you show with an example and your expected output?

Gopi_E
Creator II
Creator II

Hi Vijetha,

try like this

='Min Val : ' & min(Value) & ' and ' & 'Date :'& Date(date#(Min(Aggr(FirstSortedValue(Date,-Date),Value)),'YYYYMMDD'),'MM-DD-YYYY')& chr(13) &

'Max Val : ' & max(Value) & ' and ' & 'Date :' & Date(date#(Max(Aggr(FirstSortedValue(Date,-Date),Value)),'YYYYMMDD'),'MM-DD-YYYY')

Regards,

Gopi