Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
andriesb
Creator II
Creator II

Show one 'line with latest date' comment

within a chart i would only show the  'Comment' for  LAST 'datum volgende actie' line.

I could calculate the last date of these three lines using   max(TOTAL([datum volgende actie]))  but how to script this within the chart to only show me the last comment?

How do i have to express the script to show only the comment due latest : this should be the line where 'date volgende actie' = 29-03-2013' .I would like to add my code within this chart/ expression.

What is the syntax for this 'filtered' comment:

The result should be:

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You can use the firstsortedvalue function to get the comment for the latest date:

firstsortedvalue(CommentField, -DateField)

Keep in mind that the firstsortedvalue can only return one value, so if there are more comments for the maximum date (for the same combination of dimension values that is) then firstsortedvalue will return null.


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

You can use the firstsortedvalue function to get the comment for the latest date:

firstsortedvalue(CommentField, -DateField)

Keep in mind that the firstsortedvalue can only return one value, so if there are more comments for the maximum date (for the same combination of dimension values that is) then firstsortedvalue will return null.


talk is cheap, supply exceeds demand
andriesb
Creator II
Creator II
Author

Thanks Gysbert, it works!

I though I could do the trick using a custom filtered comment, but this syntax fails...

= {< [Datum volgende actie] = ${ActiedatumLast}  >} Gespreksnotitie

where ActiedatumLast is the 'max date'

Shouldn't it be possible to add a custom filter in this way?

Gysbert_Wassenaar

maxstring({< [Datum volgende actie] = {$(ActiedatumLast)}  >} Gespreksnotitie) might work as long as [Datum volgende actie] isn't a dimension in your chart.


talk is cheap, supply exceeds demand
andriesb
Creator II
Creator II
Author

One more question:

How could I show  a max date where it should be calculated for each unique invoice nr?

=max ({< [Invoice Nr]  >} TOTAL([Actiedatum]))

andriesb
Creator II
Creator II
Author

my last question solved:

I searched for the max date within multiple dimentions using the aggr function:

= aggr(max(([Date next action])), Invoice_Number)