Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Show which Dimension has Greatest/Max Value

I want to create a table that shows which Well has the greatest daily Depth_Drilled.

WellMax Dly Depth Drilled
SRC 32H3100

I'm able to get the maximum value in the database using the below in my expression tab...

     =Max({1} Total Depth_Drilled)

However, the table lists all wells (i.e., dimension) with that Maximum Depth_Drilled.

WellMax Dly Depth Drilled
Mtn Range 12H3100
Erie Cnty 5H3100
SRC 32H3100
Punxy 10V3100
Durango 7V3100

What is the code to only show the exact well/dimension with the maximum Depth_Drilled?  Also, if I wanted to show which well had the maximum within the last six months what is the code to show that timeframe?

Thanks,

Mindy

1 Solution

Accepted Solutions
MVP
MVP

Re: Show which Dimension has Greatest/Max Value

Remove the TOTAL qualifier from your expression and use a dimension limit in your straight table chart properties to show only the top value.

7 Replies
MVP
MVP

Re: Show which Dimension has Greatest/Max Value

Remove the TOTAL qualifier from your expression and use a dimension limit in your straight table chart properties to show only the top value.

Not applicable

Re: Show which Dimension has Greatest/Max Value

Thanks Swuehl, this works but not in the way that I need it. I want this table chart to always show the well with the max depth no matter what other selections are made by the user.

Not applicable

Re: Show which Dimension has Greatest/Max Value

Never mind.  I got it to work as you described for the historical pull.  Thanks.

What about the data pull for the last 6 months?

MVP
MVP

Re: Show which Dimension has Greatest/Max Value

Yes, should be taken care of by your use of set identifier {1}

MVP
MVP

Re: Show which Dimension has Greatest/Max Value

You haven't told much about the date dimension in your data model, so just guessing.

Try something like

  =Max({1<Date = {">=$(=AddMonths(Today(),-6))"}>} Depth_Drilled)

Not applicable

Re: Show which Dimension has Greatest/Max Value

The date dimension code doesn't work.  It brings me the max depth without taking the 6-month timeframe into consideration.

MVP
MVP

Re: Show which Dimension has Greatest/Max Value

It's probably just a matter of formatting or interpreting your dates correctly.

But it's not really a fun game to guess what the problem might be, without knowing anything about your model and data. Why don't you come up with some sample data, best by posting a small sample QV app.

Or just select the last 6 month in your date dimension and then you will get your result (after removing the {1} set identifier).