cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to fetch field values after group by snap which are not part of group

Ravi
New Contributor

Hi,

After using group by logic for combination of fields the downstream snaps are loosing the values.

Example:
Input file fields: field1, field2 field3, field4,Test1,test2
group by Logic Used for: field1, field2 field3
after above step : values are not finding for field4,Test1,test2.
how to get original values.
Thanks,

3 REPLIES 3

koryknick
Employee
Employee

If you preview the documents after the Group By snap, there should be a โ€œgroupโ€ field which is an array containing the fields not used in the Group By property.

Ravi
New Contributor

Hi Kory,
Thanks for response.
Iam using Aggregate/group by columns, where it is not available, is there a way for this?
Thanks,

koryknick
Employee
Employee

Perhaps we need more information here so we understand what you are expecting from the output. An Aggregate snap works much like a database Group Byโ€ฆ fields not listed in the โ€œGroup-By-Fieldsโ€ property can have an aggregate function applied (sum, count, min, max, etc.) in the โ€œAggregate fieldsโ€ table and would no longer be present in the output (except in aggregated form as specified).

Please review the Aggregate snap documentation to ensure this is the action you are looking for.
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438462/Aggregate

It almost sounds like you may really need either the โ€œGroup By Nโ€ or โ€œGroup By Fieldsโ€ snap.

On the other hand, if you are trying to get aggregate values and keep the detail documents, you may need to use a Copy before the Aggregate, and Join the documents back after the Aggregate.