Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
;
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
;
Thanks a lot... Sorry i missed........
No problem. It's a mistake most of us make at least once. I certainly have several times.