Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rangemax and concat issue

Hi all,

I have a weird issue trying to combine concat and rangemax.

The formula

concat (DISTINCT DiagnosisYear,',')  returns 2012,2020,2024.

But the formula rangemax(concat (DISTINCT DiagnosisYear,',')) returns a null (  -  ) value.

It is the same with nummax and on several applications with different datamodels.

I'm getting completely crazy. This is supposed to be the easier part of the app...

May anyone help me ?

Thanks in advance.

Younes

1 Solution

Accepted Solutions
swuehl
MVP
MVP

concat will return a string.

rangemax expects numeric values.

You might get what you want, if you first execute the concatenation in a dollar sign expansion, thus rangemax will interprete the string as arguments:

=rangemax( $(=concat(DISTINCT DiagnosisYear,',') ) )

View solution in original post

3 Replies
swuehl
MVP
MVP

concat will return a string.

rangemax expects numeric values.

You might get what you want, if you first execute the concatenation in a dollar sign expansion, thus rangemax will interprete the string as arguments:

=rangemax( $(=concat(DISTINCT DiagnosisYear,',') ) )

Not applicable
Author

Thank you very much for your answer. It works. But this expression (with the dollar symbol) is only evaluated once in a chart...

My real expression is :

Sum

(if(DiagnosisYear=rangemax( $(=concat(DISTINCT if(DiagnosisYear<=Plan,Plan),',') ) ),[TOTAL PE \ ]))

Plan is my dimension... and as all the dollar expression is evaluated once, it does not work... like when you do set analysis on chart dimensions

swuehl
MVP
MVP

Right, the dollar sign expansion is only evaluated once per chart.

Maybe you can use so called advanced aggregation (i.e. the aggr() function) to get what you need.

Could you upload a small sample app or a more complete description of your data model incl. some sample data?