Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
surendraj
Specialist
Specialist

Max date value for all dates

Hi All,

i have date and sales fields in a table  as show below

Q_WK_IDSum(Sales)
5/4/201912292716
5/11/201912696990
5/18/201913225049
5/25/201913217132
5/2/20205678109

 

output required

Q_WK_IDSum(Sales)
5/4/20195678109
5/11/20195678109
5/18/20195678109
5/25/20195678109
5/2/20205678109

 

where i need replace the values with the max of date sales values . so whenever the user selects any date the above must be shown , 

how can we achieve this  .. its urgent .. plz ...

i have tried using firstsortedvalue(sales,-q_wk_id) which did not work .. 

thanks in advance 

 

Labels (3)
4 Replies
Vegar
MVP
MVP

Assuming that Q_WK_ID is formated as a date field. Try this expression:

sum({<Q_WK_ID={'$(=MaxString(Q_WK_ID))'}>}TOTAL Sales)

I

surendraj
Specialist
Specialist
Author

Thanks for response ..

when i don't select the date .. i am getting the max date of sale vale .. 

but when i select the date .. its not showing the correct value .. 

however , i have given 

sum({<Q_WK_ID={'$(=MaxString(Q_WK_ID))'},Q_WK_ID=>}TOTAL Sales)

still i m getting incorrect value when date is selected 

Vegar
MVP
MVP

When you select [Date] you are actually combining the expression SET with your selection. 

I do not know your data model and how date is correlated with Q_QK_ID, but in similar situations you some times want to ignore the [Date] selection and use an expression similar to this:

sum({<[Date]=, [Q_WK_ID]={'$(=MaxString([Q_WK_ID]))'}>}TOTAL Sales)

surendraj
Specialist
Specialist
Author

date itself is Q_QK_ID.

i have written and i worked .. 

sum({< [Q_WK_ID]={'$(=MaxString({<Q_QK_ID=>}[Q_WK_ID]))'}>}TOTAL Sales)

 

thanks for response ..