Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

invalid expression?

Hi,

Can anyone help with my script (I am a newbie on QlikView) below.

I am getting an error in the expression sum([Project Revenue] / sum([Hours Quantity]. Why?

thanks!

//*****Work*****

Work:

LOAD

     [Project Number],

     [Project Name],

     [Project Type],

     [Customer Name],

     [Full Name] as Employee,

     [Prod Unit Code],     

     Skill,

     [Hours Quantity],

     [Task Name],

     [Task Number],

     [Expenditure Type],

     [Bill Rate],

     [Cost Rate],

     [Project Revenue],

     [Project Cost],

     Month,

     [Project Revenue]-[Project Cost] as Contribution

FROM

[..\reformatted\Weekly CSD September_Aug_dummydata.xlsx]

(ooxml, embedded labels, header is 3 lines, table is [Rapport 1]);

Join (Work)

LOAD [Project Number],

    sum([Project Revenue])/sum([Project Revenue]) as COR

    Resident Work;

1 Solution

Accepted Solutions
Not applicable
Author

Hi Gordaman,

The first thing I see is sum([Project Revenue])/sum([Project Revenue]) as COR this is twice the same variable.

If you want  sum([Project Revenue]) you should use an aggregation variable.

Below resident you type group by.

Hope this is helpful.

gr.

Frank

View solution in original post

5 Replies
m_woolf
Master II
Master II

No comma at end?

llauses243
Creator III
Creator III

Hi,

In general when you use sum or count or ...

Also you must to use group by

I suggest you review help LOAD

Good luck, Luis

Not applicable
Author

Hi Gordaman,

The first thing I see is sum([Project Revenue])/sum([Project Revenue]) as COR this is twice the same variable.

If you want  sum([Project Revenue]) you should use an aggregation variable.

Below resident you type group by.

Hope this is helpful.

gr.

Frank

SunilChauhan
Champion
Champion

use group by  in resident table like below

//*****Work*****

Work:

LOAD

     [Project Number],

     [Project Name],

     [Project Type],

     [Customer Name],

     [Full Name] as Employee,

     [Prod Unit Code],     

     Skill,

     [Hours Quantity],

     [Task Name],

     [Task Number],

     [Expenditure Type],

     [Bill Rate],

     [Cost Rate],

     [Project Revenue],

     [Project Cost],

     Month,

     [Project Revenue]-[Project Cost] as Contribution

FROM

[..\reformatted\Weekly CSD September_Aug_dummydata.xlsx]

(ooxml, embedded labels, header is 3 lines, table is [Rapport 1]);

Join (Work)

LOAD [Project Number],

    sum([Project Revenue])/sum([Project Revenue]) as COR

    Resident Work group BY  [Project Number],;

Sunil Chauhan
Not applicable
Author

Thanks everyone! I got it working now!