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: 
Anonymous
Not applicable

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
sunny_talwar

May be this

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

View solution in original post

4 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

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?

Anonymous
Not applicable
Author

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

antoniotiman
Master III
Master III

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;

sunny_talwar

May be this

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