Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jerownimow
Contributor III
Contributor III

How to sum group by with specific conditions?

Hi Folks,
Good day!

I would like to request for your help on my problem:

I have the following requirements:
1. If itemGroupId are all +, add all, and get the items from the first item
2. If itemGroupId are all -, load them as is.
3. If itemGroupId are both + and -, equate them, and get the other fields on the first item.

 

And the source is this:
0683p000009M8fn.png
I somehow manage to achieve this by the below logic:
0683p000009M8fs.png

And the result is this:

0683p000009M8fx.png

The problems with this logic are the following:

1. How can I extract the aggregated level?
2. On 708157001, it was not all summed up because the 2 of 3 of the items have the same sign, which should be added up based on the 3rd requirement.
3. How can I get the other fields from the first item only for 1st and 3rd requirement? because there were other fields aside from those 2.

Badly needed your help. Please let me know if you need more info.

Thank you so much!

Labels (3)
11 Replies
jerownimow
Contributor III
Contributor III
Author

Thank you so much @rhall . Have solved the other issues posted here but still have new problems while going on the succeeding process. Will be posting on other topic.

Anonymous
Not applicable

Thanks for posting in new topics. It makes it so much easier for people to find solutions when the problems are separated out.