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: 
bushpalaamarnat
Creator
Creator

Group by - invalid expression error fix!

Here is my table:

Brand_Analysis:

NoConcatenate

LOAD

Area,

Year,

     Month,

     [Year/Month],

        [Rx vs CH 2],

     [Supply Chain],

     Region,

     Market,

     [Market 2],

     [Category 1],

     [Category 2],

     [Category 3],

     [Therapeutic Area],

    [Global Brand],

     [Raw Materials],

     WIP,

     API,

     [FG (inc. Other)],

     Provisions,

     [Net Inventory],

     [Memo: Strategic Inventory],

     [Net Inventory less Strategic],

     [Brand Category],

     [Site Category],

     [Site Flow Location],

     [Brand (DIO)],

     [Product Group],

     [Global Planning Therapy],

     Brand_Site,

     Franchise,

     sum(if([Site Flow Location]='Primary', [Raw Materials])) AS [Primary RawMaterials]

             

Resident Brand_Analysis1

group by Area, Year, Month,[Year/Month],[Rx vs CH 2];

Drop Table Brand_Analysis1;

I am getting invalid expression error.

What i am trying to do is calculate primary raw material .

The point is

in chart, i have created sum function to calculate Primary Raw Materials and  second raw materiel . however unable to produce or select data to filter for only primary raw material.

1 Solution

Accepted Solutions
marcus_sommer

You need to include all fields within the group by which aren't aggregated not only a few ones.

- Marcus

View solution in original post

3 Replies
marcus_sommer

You need to include all fields within the group by which aren't aggregated not only a few ones.

- Marcus

bushpalaamarnat
Creator
Creator
Author

Thank you Marcus... it worked. and was correct answer.

This thread does not show me option to select correct answer. is there a way to do that when it does not give option "correct answer".

marcus_sommer

It's a limitation from the inbox that the correct button is missing and that no attachments are visible or that the advanced editor isn't available - just opening this thread within a new tab and it will work.

- Marcus