4 Replies Latest reply: Jan 9, 2018 11:53 PM by Jonathan Dienst

# Invalid expression

Invalid expression  *, when i put al column in group by , works but dont need put all column  , i have to calculated mesures by client ID

CLIENT:

MMM,

SMV,

NBR

FROM

[C:\Users\90160\Desktop\portfeuille\MMM.qvd]

(qvd);

Score:

CLIENT_ID,

MMM/(MAX (MMM))*100 as MMM1,

SMV/(MAX (SMV))*100 AS VRD1,

NBR/(MAX (NBR))*100 AS RELATION1

resident CLIENT

Group BY CLIENT_ID;

• ###### Re: Invalid expression

Well, thats the only whay here, use all Field in Group by.

But that will gives you one measure per CLIENT_ID,or?

Score:

CLIENT_ID,

MMM/(MAX (MMM))*100 as MMM1,

SMV/(MAX (SMV))*100 AS VRD1,

NBR/(MAX (NBR))*100 AS RELATION1

resident CLIENT

Group BY CLIENT_ID,MMM,SMV,NBR;

• ###### Re: Invalid expression

You can't reference max(MMM) and MMM in the same load statement. This will need 3 steps:

CLIENT:

MMM,

SMV,

NBR

FROM

[C:\Users\90160\Desktop\portfeuille\MMM.qvd]

(qvd);

Join(CLIENT)

CLIENT_ID,

MAX (MMM) as MMM1,

MAX (SMV) AS SMV1,

MAX (NBR) AS NBR1

Resident CLIENT

Group BY CLIENT_ID;

Score:

MMM,

SMV,

NBR,

MMM / MMM1 * 100 as MMM1,

SMV / SMV1 * 100 as VRD,

NBR / NBR1 * 100 as RELATION

Resident CLIENT;

DROP Table CLIENT;

• ###### Re: Invalid expression

thank you  Jonath but with this script i have the same result for all MMM SMV NBR

• ###### Re: Invalid expression

I suggest you post a small sample qvw and data file and clearly indicate the output you require.