Hi All,
i have date and sales fields in a table as show below
Q_WK_ID | Sum(Sales) |
5/4/2019 | 12292716 |
5/11/2019 | 12696990 |
5/18/2019 | 13225049 |
5/25/2019 | 13217132 |
5/2/2020 | 5678109 |
output required
Q_WK_ID | Sum(Sales) |
5/4/2019 | 5678109 |
5/11/2019 | 5678109 |
5/18/2019 | 5678109 |
5/25/2019 | 5678109 |
5/2/2020 | 5678109 |
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
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
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
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)
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 ..