Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Partner
Partner

Re: Min max values

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)

Highlighted
Champion III
Champion III

Re: Min max values

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

Highlighted
Specialist
Specialist

Re: Min max values

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.

Highlighted
Champion III
Champion III

Re: Min max values

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?

Highlighted
Creator II
Creator II

Re: Min max values

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