Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

patriciousa
Contributor

Insert Field when equal to other column multiple values

Hi Qlik Community.

I'm here today with what must be a really easy task.

I need to insert a Field but only when is equal to other column values.

Here is my table:

   

NombreCategoría
Manuel AndresJPE
María del MarJPE
Gabriela SusanaSupervisor
GustavoDirector
ChristianSenior
Damian UrielJP
RamonGerente
HernanGerente
Leandro MartinSenior
Carlos MatiasSenior

I want to insert in my table in Qlik Sense the Column "Nombre" when "Categoría" is equal to JP, JPE and Senior.

I bet this has to be like the easiest thing in Qlik but I can't figure out how to do it.

Thank you in advance.

Regards.

1 Solution

Accepted Solutions
MVP
MVP

Re: Insert Field when equal to other column multiple values

When using it as a dimension you need an Aggr function, try this:

=Aggr(Only({<Categoria = {'JPE', 'JP', 'Senior}>} Nombre), Nombre)

Alternatively this should also work:

=If(Match(Categoria, 'JPE', 'JP', 'Senior), Nombre)

But my suggestion is that you can get the same result by using set analysis in all your expressions. You just need to use Nombre as dimension and then within the expression use {<Categoria = {'JPE', 'JP', 'Senior}>}

For example if your current expression is -> Sum(Sales), change it to Sum({<Categoria = {'JPE', 'JP', 'Senior}>}Sales) Your Nombre will only show those names which are from one of the three Categoria listed in the set analysis. This is more efficient then using calculated dimension.

12 Replies
MVP
MVP

Re: Insert Field when equal to other column multiple values

May be this:

LOAD Nombre,

          Categoria

FROM Source

Where Match(Categoria, 'JPE', 'JP', 'Senior');

patriciousa
Contributor

Re: Insert Field when equal to other column multiple values

To clarify, I need to Load all the categories, however, in the table view I'm making in Qlik Sense, I only have to show JP, JPE, Senior.

Thank you for your reply.

MVP
MVP

Re: Insert Field when equal to other column multiple values

Oh okay, may be this in that case:

{<Categoria = {'JPE', 'JP', 'Senior}>}

This will go within all your expressions.

patriciousa
Contributor

Re: Insert Field when equal to other column multiple values

Thank you for quick reply Sunny-T but still need help.

The expression you gave is looking good but I need to insert the "Nombre" Column when {<Categoria = {'JPE', 'JP', 'Senior}>}

How do I do it?

Thank you again!

MVP
MVP

Re: Insert Field when equal to other column multiple values

Not entirely sure how and where you are using this, but may be this:

Only({<Categoria = {'JPE', 'JP', 'Senior}>} Nombre)

patriciousa
Contributor

Re: Insert Field when equal to other column multiple values

Qlik Sense, as Dimension, in a Table.

There, where it says Colaborador JP-Seniors. I need to insert only the "nombre" when is equal to those categories.

If I paste what you gave me Only({<Categoria = {'JPE', 'JP', 'Senior}>} Nombre) it says Error in Expression.

Try adding a , before Nombre, didn't work.

The Field "Nombre" is not being recognized as a Field.

Thank you.

Regards.

MVP
MVP

Re: Insert Field when equal to other column multiple values

When using it as a dimension you need an Aggr function, try this:

=Aggr(Only({<Categoria = {'JPE', 'JP', 'Senior}>} Nombre), Nombre)

Alternatively this should also work:

=If(Match(Categoria, 'JPE', 'JP', 'Senior), Nombre)

But my suggestion is that you can get the same result by using set analysis in all your expressions. You just need to use Nombre as dimension and then within the expression use {<Categoria = {'JPE', 'JP', 'Senior}>}

For example if your current expression is -> Sum(Sales), change it to Sum({<Categoria = {'JPE', 'JP', 'Senior}>}Sales) Your Nombre will only show those names which are from one of the three Categoria listed in the set analysis. This is more efficient then using calculated dimension.

patriciousa
Contributor

Re: Insert Field when equal to other column multiple values

You got it! It worked!

Thank you a lot, again!

Regards!

MVP
MVP

Re: Insert Field when equal to other column multiple values

Hahahaha, More like 'We got it'