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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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


talk is cheap, supply exceeds demand