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: 
alexandernatale
Creator II
Creator II

subtotal grouping row dimension table

Hi everyone,

I have a strange problem, I hope someone can help me!

I have a table made like this:

alexandernatale_0-1676991618754.png

What I would like to have is a grouping like this:

Area 1: plant 1
Area 1: plant 2
Area 2: plant 3
Area 3: plant 4

alexandernatale_1-1676991808279.png

 

Since it's an impromptu analysis, I don't want to change the data structure.
I tried with different formulas like "pick" and "match" and "aggr" but I didn't get out.

Can someone help me?

 

Thanks!

Labels (5)
1 Solution

Accepted Solutions
henrikalmen
Specialist
Specialist

I think the best thing for you is if you can include the Area dimension in your data model, basically so that you have a table that looks something like
plant, area, value
Plant1, Area1, 994
Plant2, Area1, 709
...

Then you could just choose what dimension to use in a table chart.

But if you really want to do it in frontend, you could try this as a calculated dimension (but you wouldn't want to do this with many rows):

if(match([plantfield], 'plant 1', 'plant 2'), 'Area 1', if([plantfield]='plant 3', 'Area 2', if([plantfield]='plant 4', 'Area 3', 'unknown area')))

View solution in original post

2 Replies
henrikalmen
Specialist
Specialist

I think the best thing for you is if you can include the Area dimension in your data model, basically so that you have a table that looks something like
plant, area, value
Plant1, Area1, 994
Plant2, Area1, 709
...

Then you could just choose what dimension to use in a table chart.

But if you really want to do it in frontend, you could try this as a calculated dimension (but you wouldn't want to do this with many rows):

if(match([plantfield], 'plant 1', 'plant 2'), 'Area 1', if([plantfield]='plant 3', 'Area 2', if([plantfield]='plant 4', 'Area 3', 'unknown area')))

alexandernatale
Creator II
Creator II
Author

Thx @henrikalmen  it's perfect for me!


if(match([plantfield], 'plant 1', 'plant 2'), 'Area 1', if([plantfield]='plant 3', 'Area 2', if([plantfield]='plant 4', 'Area 3', 'unknown area')))


in this way I don't modify the data structure as this classification is "temporary" and ad hoc for some visualizations and reports!