Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Grouping random expression values into "other" category

I have a number of values that make up my expression Journal Entry Category (for example: Journal Entry Category could be: Accrual, Inventory, Tax, Reversal, etc.)  However, some users have input numerics as their Journal Entry Category, leaving me with the previously mentioned values (Accrual, Inventory, Tax, Reversal, etc.) in addition to values such as "4", "120", "224".

What is the best method to group these 'one-off" numeric values (the "4", "120, "224") into a category called "other"?

Ultimately to leave me with Journal Entry Categories of: "Accrual, Inventory, Tax, Reversal, Other"

Rather than Journal Entry Categories of: "Accrual, Inventory, Tax, Reversal, 4, 120, 224."

I'm using a pie-chart if that makes any difference.

Thanks!

2 Replies
rubenmarin

Hi Claire, maybe the best option os to load the data as you want to use it:

// Define the types you want to LOAD

SET vJournalEntries = 'Accrual', 'Inventory', 'Tax', 'Reversal';


// Use Match as condition to set the value, if it's not in the list it will be 'Other'

LOAD CurrentField

     ...,

     If(Match([Journal Entry Category], $(vJournalEntries)), [Journal Entry Category], 'Other')

From/Resident....


To use in chart you can use this dimension:

Aggr(If(Match([Journal Entry Category], 'Accrual', 'Inventory', 'Tax', 'Reversal'), [Journal Entry Category], 'Other'), [Journal Entry Category])


Change [Journal Entry Category] for your current field name.

Anonymous
Not applicable
Author

Worked!! Thanks so much for the quick solution.