Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight Table Question

Hello,

I have a table with the following information:

JOB_NAME Max Elapsed DateTime
A00:12:51
D00:06:30
F00:03:01
G00:02:59
H00:02:46
X00:01:5011/03/2014 02:00:00

I need to print in DateTime the value relative to when the Max Elapsed moment happens, Function: (=max(DURATION))

Only the JOB_NAME=X works, i think because is only a dot and no aggregate fuction is used.

Can you help me?

Thanks!!

9 Replies
Not applicable
Author

Hey Nico,

Can you attach a table of how the result should look like.Can you also include Duration field in the table ? It will be helpful in analyzing further.

Not applicable
Author

Thanks

JOB_NAMEMax ElapsedDateTimeDuration
A00:12:51
D00:06:30
F00:03:01
G00:02:59
H00:02:46
X00:01:5011/03/2014 02:00:00

00:01:50

My dimension is JOB_NAME, I expected similar results like row X.

The chart is a TOP 10 of Max Elapsed times for data base batch executions. I need to show the batch name, the elapsed time and when the situation was.

Thanks!

Not applicable
Author

Can you attach your sample qvw file if possible. I think I am missing something but I cant quite understand how Date Time is calculated.

Not applicable
Author

DateTime is not calculated, is the data loaded directly from the data base.

"Max Elapsed" is the label for max(DURATION)

Thanks!

its_anandrjs
Champion III
Champion III

Hi,

I want to know the fields JOB_NAME, Max Elapsed, Date time and Duration all is from data base or in other way which is calculated field among this.

Thanks & Regards

Not applicable
Author

Hi Anand,


JOB_NAME= From Data Base (Dimension of the chart)

Max Elapsed= max(DURATION) *

Date time= From Data Base

*DURATION= From Data Base

Thanks!

swuehl
MVP
MVP

Try

=FirstSortedValue( DateTime, -DURATION)

as expression to retrieve the DateTime value for the max DURATION.

Not applicable
Author

Hi swuehl,

That solution was pretty  good, thanks!

I dont know why, but for same cases I don't get DateTime value.

JOB_NAMEMax ElapsedDateTime
A00:12:5111/03/2014 02:00:00
D00:06:3011/03/2014 02:02:00
F00:03:0111/03/2014 02:03:00
G00:02:5911/03/2014 02:04:00
H00:02:46-
X00:01:5011/03/2014 02:00:00

For example for row H I have 4 DateTime for it, may be the last should be selected?:

10/03/2014 19:41:30

10/03/2014 19:45:30

11/03/2014 01:32:00

11/03/2014 01:44:00

Cheers

swuehl
MVP
MVP

With same cases, you mean the records share the same DURATION?

That's an issue with FirstSortedValue(), it will return NULL when there are more than 1 record with the same sort weight.

You can use

=FirstSortedValue(DISTINCT DateTime, -DURATION)

to get a value back, but the will not necessarily return the latest DateTime.

You can consider adding a small number to your sort weight based on DateTime to distinguish between the DateTime values.