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

Dimension grouping based on another dimension

Hi, 

I try to do cost analysis where I group suppliers that  have many similar companies under one supplier name .  I succeeded to do this with if statement:

=if(WildMatch([Supplier ID], '1111', '1112','1113' ),'Orange', if(WildMatch([Supplier ID], '2222'),'Apple', 'Other')

Now the problem is that this year Apple started to supply Orange's products. I would like to still follow the costs of those products under the name of Orange. To separate Orange's costs from Apple's costs, there is an additional code "1234" that is used.

So the data is now:

Supplier IDSupplier nameCodeCosts
1111Orange East 10
1112Orange West 20
1113Orange South 30
2222Apple123450
2222Apple 20

 

Now I would like to see in a report that the total cost of Orange is (10+20+30+50)= 110  and total cost of Apple is 20 using that code. How am I able to achieve that? 

 

Labels (1)
1 Solution

Accepted Solutions
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hey Limonadi,

 

Try this:

=if(WildMatch([Supplier ID], '1111', '1112','1113' ) OR Code='1234','Orange', if(WildMatch([Supplier ID], '2222') AND Code<>'1234','Apple', 'Other')

 

I hope that helps!

 

Kind regards,

S.T.

View solution in original post

2 Replies
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hey Limonadi,

 

Try this:

=if(WildMatch([Supplier ID], '1111', '1112','1113' ) OR Code='1234','Orange', if(WildMatch([Supplier ID], '2222') AND Code<>'1234','Apple', 'Other')

 

I hope that helps!

 

Kind regards,

S.T.

Limonadi
Contributor
Contributor
Author

It worked perfectly, thank you!