Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
icaro_povoa
Contributor II
Contributor II

Calculation on Script

Deal All,

I am trying to build a dashboard witch will be a combination of a lot of Excel files.

To avoid creating SK, I am trying to rename the attributes according to one unique nomenclature and doing a join on all other tables.

Basically I am creating attributes to be filters ( Country, Month, Year, Region....) and one unique attribute called Results for being my expression.

 

The issue is that not all the tables, my result is located in a unique column. Sometimes I will need to have a calculation for creating this attribute "Results".

The most comum calculatation that I need is something like.

((CRITERIA1)/(CRITERIA2))*100 as Results

When trying this, I am receiving an error on the script. (Invalid Expression)

I am quite new on script modeling, so please let me know if this is not the best approach.

Regards

Labels (2)
4 Replies
Clever_Anjos
Employee
Employee

Would you mind posting your script that generates the error?

_________
Clever dos Anjos
Have fun, be Qlik 🙂

icaro_povoa
Contributor II
Contributor II
Author

Follow the script:

QUALIFY Comments;
Directory;
NAKPIS:
LOAD KPI,
BSC,
Territory,
Team,
Crop,
Brand,
Month,
Result,
Grouping,
Lower,
Upper,
[Traffic Light]

FROM
Example.xlsm
(ooxml, embedded labels, table is Database);


HSE:
Directory;
Join(NAKPIS)
LOAD 'IIR' as KPI,
'Safety' as BSC,
'Strategic' as Grouping,

Month ,
[Hours Worked],
Recordables,
(sum(Recordables)/sum([Hours Worked])*200000) as Result

FROM
.....

Clever_Anjos
Employee
Employee

LOAD 'IIR' as KPI,
'Safety' as BSC,
'Strategic' as Grouping,

Month ,
[Hours Worked],
Recordables,
(sum(Recordables)/sum([Hours Worked])*200000) as Result

FROM

 

If you have a sum() you´re supposed to have a GROUP BY clause, do you have one?

icaro_povoa
Contributor II
Contributor II
Author

Hi,

 

No I don´t.  Can you help me with this?

I have no idea how to do it. 😕 

Regards