Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
kulwantsaj219
Contributor II

scripting

Hi All ,

How to get the expected output column through script or front end. for jan month we need to divide all values with the first value   

month1salexpected output
jan1111 divide by 11
jan33 divide by 11
feb1313 divide by 13
feb1111 divide by 13
feb1010 divide by 13
mar4444 divide by 44
mar3333 divide by 44
mar2222 divide by 44

Regards

1 Solution

Accepted Solutions
Highlighted

Re: scripting

May be this

Sum(sal)/Sum({<emp = {1}>} TOTAL <month1> sal)

View solution in original post

4 Replies
Highlighted
Partner
Partner

Re: scripting

Hi kulwant,

Your data makes no distinction between similar months, having 2 times january, 3 times february and march.

What's the logic behind it, can you explain it a little more?

Highlighted
kulwantsaj219
Contributor II

Re: scripting

month1empsalexpected output
jan11111 divide by 11
jan233 divide by 11
feb11313 divide by 13
feb21111 divide by 13
feb31010 divide by 13
mar14444 divide by 44
mar23333 divide by 44
mar32222 divide by 44

l have added emp column

Highlighted
antoniotiman
Honored Contributor III

Re: scripting

May be this

Table:
LOAD * Inline [
month1, sal
jan, 11 
jan, 3
feb, 13
feb, 11
feb, 10
mar, 44
mar, 33
mar, 22]
;
Left Join
LOAD month1,FirstValue(sal) as sal1
Resident Table
Group by month1;
Noconcatenate LOAD month1,sal,sal/sal1 as sal1
Resident Table;
Drop Table
Table;

Highlighted

Re: scripting

May be this

Sum(sal)/Sum({<emp = {1}>} TOTAL <month1> sal)

View solution in original post