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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
cristian_av
Creator III
Creator III

Error in Expression while using FirstValue

Hi

I'm trying to group my data, but I get "error in expression". This is what i'm writing:

any idea?

LOAD Temporada,

     Semana,

     Ejec.Comercial,

     DetalleWeek,

     [Estado Week],

     NegocioWeek,

     [N° Embarque],

     [Est. Embarque (3D)],

     [Est. Embarque (ERP)],

     [Est. Doc. Embarque (ERP)],

     FirstValue([Pallets Week]) as PalletWeek

FROM (qvd)

GROUP BY DetalleWeek,NegocioWeek;

1 Solution

Accepted Solutions
sunny_talwar

You have multiple non-aggregated fields in your load statement.... you will either need to add all of them to your group by or you need to remove them from your load statement. Essentially, based on your aggregation requirement, you need to have all your non-aggregating fields in your group by clause.

View solution in original post

2 Replies
sunny_talwar

You have multiple non-aggregated fields in your load statement.... you will either need to add all of them to your group by or you need to remove them from your load statement. Essentially, based on your aggregation requirement, you need to have all your non-aggregating fields in your group by clause.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

The GROUP BY load has very strict rules - you can only list fields that you are aggregating by, and aggregated values. In your example, you have 10 fields in the LOAD list, but only 2 fields in the GROUP BY list - that's not allowed. You can have either 2 fields in both lists, or 10 fields in both lists - in addition to your aggregations. FistValue() actually looks good, there shouldn't be any issues there.

cheers,

Oleg Troyansky

Upgrade Your Qlik Skills at the Masters Summit for Qlik - coming to Boston, MA this October!