Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. $300 savings extended to February 9th Learn More
rishimessi19
New Contributor II

FirstSortedValue and Max functions

Hi

I have a requirement to replicate a straight table as individual text boxes as shown in screenshot below. I am using Max and First Sorted Value expressions (Expressions pasted below). Somehow these functions only consider distinct values. In my example "68" is repeated twice but Max function only considers it once and first sorted value ignore completely. How do I resolve this?

Expressions I am using:

max(Aggr(XXX,Dimension),1) ---->1,2,3,....7

FirstSortedValue(Dimension,-(Aggr(XXX,Dimension)),1) ---->1,2,3,....7

2 Replies
MVP & Luminary
MVP & Luminary

Re: FirstSortedValue and Max functions

You need to make the max value unique somehow. Perhaps this will do:


FirstSortedValue(Dimension,-(Aggr(XXX*1000+Ord(Left(Dimension,1)),Dimension)),1)


talk is cheap, supply exceeds demand
MVP
MVP

Re: FirstSortedValue and Max functions

Try something like

FirstSortedValue(Dimension,-(Aggr(XXX+FieldIndex('Dimension',Dimension)/1000 ,Dimension)),1) ---->1,2,3,....7


FirstSortedValue(Aggr(XXX,Dimension),-(Aggr(XXX+FieldIndex('Dimension',Dimension)/1000 ,Dimension)),1)