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

How do I script out the following

I have a sheet called data and a sheet called points.  I want to join the score1, score2, score3, score4 from the data sheet to the points sheet. Take the weight from the point sheet muliple it by the data sheet and sum it up for each company.

9 Replies
arsal_90
Contributor III

Re: How do I script out the following

Please find the attached file and let me know is this the desired result

amartinez35
Valued Contributor

Re: How do I script out the following

Hi,

CrossTable(Name,Data, 1)

LOAD Comp,

     Score1,

     Score2,

     Score3,

     Score4

FROM

[testdata.xlsx]

(ooxml, embedded labels, table is Data);

Directory;

LOAD Name,

     Weight

FROM

[testdata.xlsx]

(ooxml, embedded labels, table is Weight);

Best,

Aurélien

rustyfishbones
Honored Contributor II

Re: How do I script out the following

You can use CrossTable.

See the blog post currently available in your Qlik Community home tab

2014-03-26_1505.png

Regards

Alan

Not applicable

Re: How do I script out the following

Look at the attacched file...

Hope this helps

Not applicable

Re: How do I script out the following

How do I also have another column that is the sum of all the multiplied scores?

arsal_90
Contributor III

Re: How do I script out the following

Can u elaborate your result in excel file. I understand what u need but if you display column wise result then it fesible for me to clearly understand your requirement

Not applicable

Re: Re: How do I script out the following

Look this new example in the attacchemnt.

Hope this helps.

Not applicable

Re: How do I script out the following

Try this

 

Test4:

CrossTable(Name,Score,1)
LOAD Comp,
Score1,
Score2,
Score3,
Score4
FROM
C:\testdata.xlsx
(
ooxml, embedded labels, table is Data);

Left Join
LOAD Name,
Weight
FROM
C:\testdata.xlsx
(
ooxml, embedded labels, table is Weight);

Chart Exp:

=SUm(Score)

=Sum(Weight)

=Sum(Score*Weight)

If this is not correct then reply with your required result..

MVP
MVP

Re: How do I script out the following

With a left join there you run the risk of duplicating rows in the main table with duplicate weights.  I would suggest an ApplyMap, or simply leaving as an association.

Community Browser