Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
icaro_povoa
New 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
Employee
Employee

Re: Calculation on Script

Would you mind posting your script that generates the error?

_________
Clever dos Anjos
Have fun, be Qlik Smiley Happy

icaro_povoa
New Contributor II

Re: Calculation on Script

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
.....

Highlighted
Employee
Employee

Re: Calculation on Script

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
New Contributor II

Re: Calculation on Script

Hi,

 

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

I have no idea how to do it. :-/ 

Regards

Community Browser