Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Finding the Max Value in Text Object

Hi,

I have a specific query where I need to find the information from my field updatetxt depending on the value of another field udindex.  I created a text object and on my expression wrote the following:

if(max(udindex),updatetxt)

However the text field is blank.  I suspect this is because my udindex can be anywhere from 1 to 113 and therefore when I click on the specific record that has a primary key of callref, it cannot see which text field I need.

Is there a way that I can add in my expression to get the data from updatetxt depending on the MAX value?

Regards,

Jon Ditchfield

1 Solution

Accepted Solutions
Not applicable

Re: Finding the Max Value in Text Object

You can use firstsortedvalue() as long as udindex is a number and there is only one Updatetxt field for the max(udindex) value.

= Firstsortedvalue(Distinct Updatetxt, - udindex)

Thanks

4 Replies
Not applicable

Re: Finding the Max Value in Text Object

try:

=concat({<udindex = {$(max(udindex))}>}updatetxt)

Not applicable

Re: Finding the Max Value in Text Object

what kind of values are these fields holding?  strings? numeric answers?

Not applicable

Re: Finding the Max Value in Text Object

You can use firstsortedvalue() as long as udindex is a number and there is only one Updatetxt field for the max(udindex) value.

= Firstsortedvalue(Distinct Updatetxt, - udindex)

Thanks

Not applicable

Re: Finding the Max Value in Text Object

Hi Robert,

The callref is the specific value we want to report and on the callref column there is a unique value called udindex.  The first udindex is value is always 0 and is populated when a call is logged with the issue on it.  The last value can be anything from 1-150.  updatetxt is the column specific to the udindex, so it looks like the following:

Callref       udindex      updatetxt

221221      0               call logged for installation of office

221221      1               call closed - Office 2010 Installed

Data Types:

callref = numeric

udindex = numeric

updatetxt  = int

Regards,

Jon Ditchfield

Community Browser