Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
bharatkishore
Creator III
Creator III

Group By issue

Hi All,

I have the following table.

NR:

LOAD Country as Country_NR,

    

     Modality as Modality_NR,

     Entitlement,

     Date(Makedate((LEFT(Period,4)),(Right(Period,2)),01),'MM/DD/YYYY') AS Period_NR,

     Date(Makedate(LEFT(Period,4)),'YYYY') as Year_NR,

     Date(Makedate((LEFT(Period,4)),(Right(Period,2)),01),'MMM') as Month_NR,

     Year,

    

     [% NORMIB],

     Consumption

    

FROM

[..\QVD\NR.qvd]

(qvd);

Now in the second table when i load:

SC:


LOAD Month_NR,

Year_NR,

Entitlement,

Country_NR,

Modality_NR,

'1' as KPIScope,

sum(Consumption) as Numerator,

sum([% NORMIB]) as Denominator

  

Resident NR

 

Group By Month_NR,

Year_NR,

Entitlement

;


I am getting error as invalid expression.


Can you please help me where i am doing wrong.


Thanks,

Bharat

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You need to add ALL the fields that are NOT aggregated to the Group By clause. In your case that means Country_NR and Modality_NR.


LOAD

     Month_NR,

     Year_NR,

     Entitlement,

     Country_NR,

     Modality_NR,

     '1' as KPIScope,

     sum(Consumption) as Numerator,

     sum([% NORMIB]) as Denominator

Resident

     NR

Group By

     Month_NR,

     Year_NR,

     Entitlement,

     Country_NR,

     Modality_NR

     ;


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

You need to add ALL the fields that are NOT aggregated to the Group By clause. In your case that means Country_NR and Modality_NR.


LOAD

     Month_NR,

     Year_NR,

     Entitlement,

     Country_NR,

     Modality_NR,

     '1' as KPIScope,

     sum(Consumption) as Numerator,

     sum([% NORMIB]) as Denominator

Resident

     NR

Group By

     Month_NR,

     Year_NR,

     Entitlement,

     Country_NR,

     Modality_NR

     ;


talk is cheap, supply exceeds demand
bharatkishore
Creator III
Creator III
Author

Thanks a lot... Sorry i missed........

Gysbert_Wassenaar

No problem. It's a mistake most of us make at least once. I certainly have several times.


talk is cheap, supply exceeds demand