Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ionuttatu
Contributor II
Contributor II

How to add calculated fields to a chart

Hi. It's my second day in qlik I'm trying to lear how to develop small reports in it.

My questions is the following:

How could I create something like this:

I have managed to do the first part: to get the data

But now i would like to do this calculation inside the chart.

Is this possible?

1.PNG

1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Ionut,

It looks like you need a pivot table with one dimension (month number is it?) and seven expressions.

Use these expressions:

2015: Sum({$<Year = {2015}>}Amount)

2016: Sum({$<Year = {2016}>}Amount)

2017: Sum({$<Year = {2017}>}Amount)

2017 vs 2016 % : (Sum({$<Year = {2017}>}Amount) - Sum({$<Year = {2016}>}Amount))/Sum({$<Year = {2016}>}Amount)

2017 vs 2016 : Sum({$<Year = {2017}>}Amount) - Sum({$<Year = {2016}>}Amount)

2016 vs 2015 % : (Sum({$<Year = {2016}>}Amount) - Sum({$<Year = {2015}>}Amount))/Sum({$<Year = {2015}>}Amount)

2016 vs 2015 : Sum({$<Year = {2016}>}Amount) - Sum({$<Year = {2015}>}Amount)


Drag the elements of the pivot table around so you get the month number dimension horizontal and the expressions a seven rows.


Good luck


Andrew



View solution in original post

9 Replies
eduardo_dimperio
Specialist II
Specialist II

Hi Ionut, welcome!

Yes, It's possible.

If i correctly understood you need follow this steps:

1 - Drag a table to your chart

2- Select Dimension 1  (2016, i believe)

3 - Select Dimension 2 (2017)

4- Left Click on Dimension, but now click FX, that will open a editor expression, you can put all your expression.

Obs:

Instead step 4, you can add a measure, to get other options like SUM,MAX,MIN etc.

Anil_Babu_Samineni

Glad you were on right platform

So, here consider it as all expressions in straight then enable horizontal option in presentation tab.. for percentage you need relative or should be in option enabled from number tab..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ionuttatu
Contributor II
Contributor II
Author

My Data comes from a table like this

1.PNG

This means that YEAR is a dimension - not the year value1.PNG

So - I'm stuck here

Also - do you know of a document that shows how write expressions?

effinty2112
Master
Master

Hi Ionut,

It looks like you need a pivot table with one dimension (month number is it?) and seven expressions.

Use these expressions:

2015: Sum({$<Year = {2015}>}Amount)

2016: Sum({$<Year = {2016}>}Amount)

2017: Sum({$<Year = {2017}>}Amount)

2017 vs 2016 % : (Sum({$<Year = {2017}>}Amount) - Sum({$<Year = {2016}>}Amount))/Sum({$<Year = {2016}>}Amount)

2017 vs 2016 : Sum({$<Year = {2017}>}Amount) - Sum({$<Year = {2016}>}Amount)

2016 vs 2015 % : (Sum({$<Year = {2016}>}Amount) - Sum({$<Year = {2015}>}Amount))/Sum({$<Year = {2015}>}Amount)

2016 vs 2015 : Sum({$<Year = {2016}>}Amount) - Sum({$<Year = {2015}>}Amount)


Drag the elements of the pivot table around so you get the month number dimension horizontal and the expressions a seven rows.


Good luck


Andrew



ionuttatu
Contributor II
Contributor II
Author

1.PNG

Cool, it worked! Thanks

ionuttatu
Contributor II
Contributor II
Author

Yuhhu

I managed to do it dynamic

1.PNG

effinty2112
Master
Master

Hi Ionut,

Nice - I originally started writing my suggestion with dynamic years but hardcoded instead because I thought it best to address only the question you posed and not add any complications. 

eduardo_dimperio
Specialist II
Specialist II

Hi Ionut,

Sorry my delay, i saw that you solve your problem.

But anyway get this documento about set analisys

ionuttatu
Contributor II
Contributor II
Author

Really cool, thanks!!