Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concat Question

Hi everybody,

I'm working on this Concat-formula and get again no result.

LOAD * INLINE [

Years
...,
2007,
2008,
2009,
2010

]

=max( concat( {$} distinct Years, ',') )

The result should be 2010.
you know what it is

1 Solution

Accepted Solutions
Not applicable
Author

just use: =max(Year). Than you get the same result

View solution in original post

14 Replies
Not applicable
Author

Concat creates a comma separated list, which the Max function can't handle. Try:

Rangemax(Concat({1} distinct Years, ','))


Also, why can't you use:

Max(Years)


Not applicable
Author

Why do you want to use concat and max ad the same time?

Not applicable
Author

just use: =max(Year). Than you get the same result

Not applicable
Author

Hi,

thanks for the Answer,

I want to compare selected years.

The formula in the chart is:

=Sum(
{$<Years={
$(=(max(concat({$} distinct Years,','))))
}
} sales

...


Not applicable
Author

Did you try Rangemax()? The Range functions take a comma separated list and pick out the biggest value (or smallest, etc depending on which one you're using). If you can't simply use Max(Years), then Rangemax(Concat({1} distinct Years, ',')) will do what you're trying to do.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I think you can get what you are trying with

=Sum({$<Years={ $(=(max(Years)))}>} sales)

This will sum the sales amounts for records where the year is the latest in the file (2010 in your example)\

Hope that helps

Jonathan

Edit: Formula type corrected

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

=Sum({$} sales)
jonathandienst
Partner - Champion III
Partner - Champion III

Not sure what you mean by that. Is it a question or an answer?

Jonathan

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

ignore the last postSmile

your formula
=Sum({$<Years={ $(=(max(Years)))}>} sales)
is correct.

But if I want to compare the years 2001,2003,2009, I need the Concat function

Here is the solution:
Max({$<Years={$(=(concat({$} DISTINCT Years,',')))}>}DISTINCT Years)

The Complete solution I'll post when everything is ready