Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
DyadyaFedor
Contributor II
Contributor II

grouping articles

In my app, I have a pivot table that looks like this:

Name    Age

Mary      10

Ann        11

Jane      12

Jack       3

John      6

Peter     5

I need to group Girls and Boys to have something like

Girls    33

Boys    14

 

The entire list of names is pretty long. Is there a more elegant way to write the formula then repeating if statement?

Thank you very much in advance

 

 

 

 

Labels (1)
2 Replies
Anil_Babu_Samineni

I would recommend to create mapping table like

Name, Gender

Mary, Female

Ane, Female

Jane, Male

Jack, Male

...

And then, Use expression to restrict that with Gender as dimension

Also, There should mapping field in databased otherwise we can't justince gender by seeing name

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
rubenmarin

Hi  @DyadyaFedor, if you have a table or list with Name and genre you can use a mapping or a join to merge both values:

mapGenreGroup:
Mapping LOAD
  Name,
  GenreGroup
Resident/From...;

DataTable:
LOAD
  Name,
  ApplyMap('mapGenreGroup', Name, Null()) as GenreGroup,
  OtherFields...
From/Resident...;

Using ths you only need to update the list of the mapping table to add new names, this will be better if it's loaded from a table on database, or an excel or as last option having the names listed as an inline table

mapGenreGroup:
Mapping LOAD * Inline [
Name     ,GenreGroup
Mary     ,Girls
Jack     ,Boys
...
];