Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i'm trying to create a new table in a Load Script after loading a file, but i have an "Invalid Expression" error on the Count function.
Could you please help me?
I need to count the number of item for each value of "tariff_plan"..
Here is an extract of the code:
dtf:
LOAD
CALLING_IMSI,
(if(CALLING_IMSI='',CALLED_IMSI, CALLING_IMSI)) as IMSI_def,
CALLED_IMSI,
TARIFF_PLAN,
if(EVENT_TYPOLOGY='Data',QUANTITY/(1024*1024),QUANTITY) as QUANTITY
FROM
C:\253.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
plans:
LOAD
TARIFF_PLAN,
count(distinct(IMSI_def)) as talking
resident dtf;
dtf:
LOAD
CALLING_IMSI,
(if(CALLING_IMSI='',CALLED_IMSI, CALLING_IMSI)) as IMSI_def,
CALLED_IMSI,
TARIFF_PLAN,
if(EVENT_TYPOLOGY='Data',QUANTITY/(1024*1024),QUANTITY) as QUANTITY
FROM
C:\253.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
plans:
LOAD
TARIFF_PLAN,
count(distinct(IMSI_def)) as talking
resident dtf
group by TARIFF_PLAN
;
You forgot to add group by statement due to which it was showing error.
Regards
Nitin
dtf:
LOAD
CALLING_IMSI,
(if(CALLING_IMSI='',CALLED_IMSI, CALLING_IMSI)) as IMSI_def,
CALLED_IMSI,
TARIFF_PLAN,
if(EVENT_TYPOLOGY='Data',QUANTITY/(1024*1024),QUANTITY) as QUANTITY
FROM
C:\253.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
plans:
LOAD
TARIFF_PLAN,
count(distinct(IMSI_def)) as talking
resident dtf
group by TARIFF_PLAN
;
You forgot to add group by statement due to which it was showing error.
Regards
Nitin
plans:
LOAD
TARIFF_PLAN,
count(distinct(IMSI_def)) as talking
resident dtf
group byTARIFF_PLAN
write like this
plans:
LOAD Distinct
TARIFF_PLAN,
count( IMSI_def) as talking
resident dtf group by TARIFF_PLAN ;