Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Choosing the Max date record in the straight table(Urgent)

hello All,

I am new to qlikview still learning

I really need your help urgently.My sprint is ending tomorrow.

below is my sample data.

I want to only show the number with the max order_start_date.

so here i want to show the record with order_start_date as 3.11.2016.

      

numbernamePRODUCT_IDPRODUCT_NAMETIME_ARRIVALORDER_START_DATEtime_rejected
01john1a3.11.2016 14:3716.6.20168.11.2016 12:32
01john1a3.11.2016 14:373.11.20168.11.2016 12:32

please let me know how i can do that in the straight table.

Appreciate your help.

Thanks & Regards,

jaya

10 Replies
Gysbert_Wassenaar

Don't use ORDER_START_DATE as dimension in your straight table, but add =max(ORDER_START_DATE) as expression.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert.

I did that but it still doesnt work.

Gysbert_Wassenaar

If multiple lines are shown then the combination of dimension values is unique. So, find out which dimension that is and remove it.

And make sure your date field actually contains date values and not strings of text that only look like dates. Use the date# function if necessary in the script to change a text value that looks like a date into a real date. The max function does not work on text, but only on numbers.


talk is cheap, supply exceeds demand
Not applicable
Author

hello,

The date is in the right format,

But i was not able to understand the first part of your explanation.

sorry about this,

Please if you can tell me in more detail

Chanty4u
MVP
MVP

Hi,

Did you tried

=FirstSortedValue(OrderDate,-Product)

Not applicable
Author

Thanks Chanty.

I will try this now.

rubenmarin

Hi Jaya, Qlik splits the records based on the different values of the dimensions, if a dimension has a lot of records but only 2 different values it will show only 2 values on chart.

I think this is what Gysbert saids in the first part of explanation, if you changed ORDER_START_DATE to an expression instead of dimension and it stills shows 2 rows it can be because any of the dimensions has more than one different value, it can be caused by different seconds or miliseconds in any of the dates, so it can be shown as the same value but internally has something different.


Try removing the TIME_ARRIVAL and time_rejected dimensions to check if it keeps only one row this way, if this happens then some of the dates are storing different values.


In this case you can use floor(fieldDate, 1/1440) in script to round the dates ignoring seconds and miliseconds (1440 is the number of minutes in a day)

Not applicable
Author

Thanks Ruben.

Appreciate your reply.

I am using FirstSortedValue function. But what happens if the orderdate is same for both records and i want still one record to show?

Please reply as soon as possible for you.its a bit urgent.


Thanks

rubenmarin

Hi Jaya, can you upload a sample that shows the issue and the expected result?