Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

I am trying to do some calucation scripting, how would i do the following:

so attached is the spreadsheet, how do I match the ID in points to the ID in the data sheet and than for each company take the compscore and times it by the score in the points sheet.  After that I need to add up all the totals for each company.

5 Replies
jsaradhi
Valued Contributor

Re: I am trying to do some calucation scripting, how would i do the following:

in the second table load, you can rename the field id to points that way, you have the correct association. QV will automatically associate the two tables. below is an example, use the correct field names you need and tweak as necessary!

script tab would look like:

Points:

LOAD id,
    
points
FROM
example.xlsx
(
ooxml, embedded labels, table is Points);

Data:
LOAD company,
    
id as points,
    
compscore
FROM
example.xlsx
(
ooxml, embedded labels, table is Data);

in a chart (bar or straight table would be best to start off), use dimension as company and expression as

sum(compscore*points).

test-score.png

ps: i misunderstood your requirement...you will have to use purgechar as Ajay mentioned.

Not applicable

Re: I am trying to do some calucation scripting, how would i do the following:

May be like attached.

Thanks

AJ

Not applicable

Re: I am trying to do some calucation scripting, how would i do the following:

I want the script to generate the product...
Not applicable

Re: Re: I am trying to do some calucation scripting, how would i do the following:

How about this file.

jsaradhi
Valued Contributor

Re: I am trying to do some calucation scripting, how would i do the following:

in that case, join the two tables in the above example by simply writing "join" after first table (Points) load and before second table (Data) load statements and then write the following after joining the tables in script:

NewTable:

LOAD *,
compscore*points as Product
Resident Points;

drop table Points;

Community Browser