Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
wcamarg3
Contributor II
Contributor II

How to filter one color and then select the maximum number of the other column

Hi all,

 

I am trying to filter using 'WildMatch' by the column "Model Number", and then selecting the Maximum value from the column "Week", but I am not suceeding.

This is the formula I am using: =if(WildMatch(model_number,'*4*'),Max(Week,1))

 

Does anyone have any idea?

Labels (3)
1 Solution

Accepted Solutions
Or
MVP
MVP

Assuming I read the requirement correctly, this shouldn't require Wildmatch, but rather a max with set analysis would be easiest:

Max({< [Model Number] = {"4*"} >}  Week)

Load * INLINE [
Model Number, Week
4DPJ, 8
4KOL, 8
4UJIO, 9
5UJL, 10];

Or_0-1658833754804.png

 

View solution in original post

7 Replies
MarcoWedel

Can you describe the data you have and the result you expect based on this data?

wcamarg3
Contributor II
Contributor II
Author

Hi Marco.

I have a table like this:

Model Number Week
4DPJ 8
4KOL 8
4UJIO 9
5UJL 10

 

I would like to return me the value "9", because it is the highest value from a "Model Number" which contains the number 4.

pooja_prabhu_n
Creator III
Creator III

Hi,

You can try something like this

=if(WildMatch([Model Number],'*4*'),Max(ALL{<[Model Number]={"4*"}>} Week))

Or
MVP
MVP

Assuming I read the requirement correctly, this shouldn't require Wildmatch, but rather a max with set analysis would be easiest:

Max({< [Model Number] = {"4*"} >}  Week)

Load * INLINE [
Model Number, Week
4DPJ, 8
4KOL, 8
4UJIO, 9
5UJL, 10];

Or_0-1658833754804.png

 

wcamarg3
Contributor II
Contributor II
Author

Thank you @pooja_prabhu_n . It is returning me a "-" instead of the desired value. Do you know what it could be?

Many thanks,

Wil

wcamarg3
Contributor II
Contributor II
Author

Amazing! Thank you @Or ! Really helped me!

pooja_prabhu_n
Creator III
Creator III

Basically set analysis should work, If you are using it in text box then just use =Max({<[Model Number]={"4*"}>} Week).

Verify column names like week or Week.

Check if there are any errors in expression, If possible could you please provide more details.