Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
...
];