Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Values in Text box

Hi All,

How to show max order date in text object and respective order number of that order date.

Thanks

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Then it is clear that you have dates against which there are no orders. This is not necessarily an error, but it does affect how you would determine the latest order date. You will need a set expression filter to consider only dates with orders. Something like this:

     =Date(Max({<OrderID = {'*'}>} Date))

    

For the OrderID, you could use

     =FirstSortedValue(OrderID, -Date)

     =Only({<Date = {"$(=Date(Max({<OrderID = {'*'}>} Date)))"}>} OrderID)

     =Concat({<Date = {"$(=Date(Max({<OrderID = {'*'}>} Date)))"}>} DISTINCT OrderID)

     =Max({<Date = {"$(=Date(Max({<OrderID = {'*'}>} Date)))"}>} DISTINCT OrderID)


The correct one depends on your specific requirements and data model. Adapt to fit.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

9 Replies
ecolomer
Master II
Master II

= date(max(DATE), 'YYYY/MM/DD')

Anonymous
Not applicable
Author

I need order date with order number

Anonymous
Not applicable
Author

In chart it is showing 23-02-2017 with order number and in text box i am getting 24-02-2017 order date

shivkumar300
Contributor III
Contributor III

Hi,

   use below expression

=OrderNo&'

'&max(date(OrderDate))

it is over all max date

text.JPG

after selection it's showing order no and max order date

text2.JPG

Anonymous
Not applicable
Author

Any ideas ??? ??

rahulpawarb
Specialist III
Specialist III

Hello Vijay,

Trust that you are doing well!

Please refer below given steps:

1. Create a variable to store value of Max. Order Date

//vMaxOrderDate (with current selection)

=Max(OrderDateKey)

2. Create Text Object with following definition (This will return latest OrderNumber associated with provided OrderDateKey)

='Max Order Date: ' & $(vMaxOrderDate)  & Chr(10) &

'Max Order Id: ' & Max({<OrderDateKey={"= $(vMaxOrderDate)"}>}OrderNumber)

Hope this will be helpful.

Still if you are facing some challenges then let me know.

Regards!

Rahul

Anil_Babu_Samineni

Would you provide detail with Dates and expected result in Text box?

May be floor can help you to remove null values of association. I am not sure how was your data

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I tried but Order id is not coming and order date is showing 24-02-2017 but my last order date is 23-02-2017

jonathandienst
Partner - Champion III
Partner - Champion III

Then it is clear that you have dates against which there are no orders. This is not necessarily an error, but it does affect how you would determine the latest order date. You will need a set expression filter to consider only dates with orders. Something like this:

     =Date(Max({<OrderID = {'*'}>} Date))

    

For the OrderID, you could use

     =FirstSortedValue(OrderID, -Date)

     =Only({<Date = {"$(=Date(Max({<OrderID = {'*'}>} Date)))"}>} OrderID)

     =Concat({<Date = {"$(=Date(Max({<OrderID = {'*'}>} Date)))"}>} DISTINCT OrderID)

     =Max({<Date = {"$(=Date(Max({<OrderID = {'*'}>} Date)))"}>} DISTINCT OrderID)


The correct one depends on your specific requirements and data model. Adapt to fit.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein