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

Extra row required - how to add

Hi,

I've taken a look around the forums and can't find an answer to this.

I have a simple table:

Status     Understanding     Team     Credibility

Won               9                    8               9

Lost               5                    2               4

I want to add a new calculated row that shows the difference between won/lost values so values would be 4, 6 and 5. Is this possible and how do I do it?

thanks,

Chris

17 Replies
Not applicable
Author

Hi Sangram,

this would work best for small numbers I presume but when I scale up to 6 categories and 1,000 rows it will be trickier?

Thanks,

Chris

Not applicable
Author

Very true. I can even simply create this table in Excel and load it which would work but I want Qlik to do the work for me if possible.

sunny_talwar

Is the raw data looks like this?

Status    Understanding    Team    Credibility

Won              9                    8              9

Lost              5                    2              4

or this:

StatusTypeValue
WonUnderstanding9
WonTeam8
WonCredibility9
LostUnderstanding5
LostTeam2
LostCredibility4
reddy-s
Master II
Master II

Hi Chris,

A 1000 rows should be fine, but you should only think when there are more than a million rows. So if you have less than 10000 rows, you can surely go for this.

Thanks,

Sangram.

Not applicable
Author

First one.

sunny_talwar

Check this out:

Capture.PNG

Script:

Table:

LOAD * Inline [

Status, Understanding, Team, Credibility

Won, 9, 8, 9

Lost, 5, 2, 4

];

Dim:

LOAD * Inline [

Dim

1

2

];

Table

Dimension: Pick(Dim, Status, 'Difference')

Expressions:

1) Pick(Dim, Sum(Understanding), Sum(TOTAL {<Status = {'Won'}>} Understanding) - Sum(TOTAL {<Status = {'Lost'}>} Understanding))

2) Pick(Dim, Sum(Team), Sum(TOTAL {<Status = {'Won'}>} Team) - Sum(TOTAL {<Status = {'Lost'}>} Team))

3) Pick(Dim, Sum(Credibility), Sum(TOTAL {<Status = {'Won'}>} Credibility) - Sum(TOTAL {<Status = {'Lost'}>} Credibility))

Not applicable
Author

Great thanks this works for me as well. Most appreciate the help

sunny_talwar

Awesome