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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
souadouert
Specialist
Specialist

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:

LOAD ID as CLIENT_ID ,

     MMM,

     SMV,

     NBR

FROM

(qvd);


Score:

load 

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;

4 Replies
stabben23
Partner - Master
Partner - Master

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

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

Score:

load 

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;

jonathandienst
Partner - Champion III
Partner - Champion III

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

CLIENT:

LOAD ID as CLIENT_ID ,

     MMM,

     SMV,

     NBR

FROM

(qvd);

Join(CLIENT)

LOAD

  CLIENT_ID,

  MAX (MMM) as MMM1,

  MAX (SMV) AS SMV1,

  MAX (NBR) AS NBR1

Resident CLIENT

Group BY CLIENT_ID;

Score:

LOAD CLIENT_ID,

     MMM,

     SMV,

     NBR,

     MMM / MMM1 * 100 as MMM1,

     SMV / SMV1 * 100 as VRD,

     NBR / NBR1 * 100 as RELATION

Resident CLIENT;

DROP Table CLIENT;

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
souadouert
Specialist
Specialist
Author

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

jonathandienst
Partner - Champion III
Partner - Champion III

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein