Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
udaya_kumar
Specialist
Specialist

Find the difference in value between bars in bar chart

Hi,

I have a bar chart, consider the attached image.

I want to find the difference in the values between the bars in bar chart and show that value as a line chart in combo chart.

For example:

ID 1, Value 10

ID 2, Value 24

So the difference between them is 24-10=14

then

ID 3, Value 30

So the difference between them is 30-24=6

Like this, i want to show the difference value between them as a line or trend in the combo chart.

How can we achieve this?

15 Replies
antoniotiman
Master III
Master III

(Alt(sum({<Flag={0}>} Value),0)+Alt(sum({<Flag={1}>} Value),0))-Above(Alt(sum({<Flag={0}>} Value),0)+Alt(sum({<Flag={1}>} Value),0))
udaya_kumar
Specialist
Specialist
Author

Yes, almost we have reached at my requirement.

Sometimes i get multiple bars for same date, that time it is not working.

Like shown in the attached image,

sunny_talwar

What would the trend line look like when this is the case?

udaya_kumar
Specialist
Specialist
Author

It is coming like this way in the chart.

Please check the attached image.

I want the difference value here like

267-592=-325 (Bar 1 and 2)

592-267=325 (Bar 2 and 3)

207-592=-385 (Bar 3 and 4)

465-207=258 (Bar 4 and 5)

910-465=445 (Bar 5 and 6)

And these values -325,325,-385,258,445 in the trend lines in the same chart.

Not applicable

Hi Uday,

Attaching 2 files:


1> App1.qvw has similar chart developed as per your "Bar Chart1.png"

2> App2.qvw has bar chart developed based on "Test.xlsx".


I have calculated Difference Line values in the script and shown against max ID for each month.


Hope this suffices your requirement as I assumed calculation logic is based on the "Bar Chart1.png".

11.PNG

udaya_kumar
Specialist
Specialist
Author

Hi parag,

Thanks for the reply.

I want the chart similar to the one attached.

I want the difference in values between each bars. If you consider the first set of bars, values of bars are like 10,24,30,40,50. So i want the difference in values between them like 24-10 = 14, 30-24 = 6, 40-30 = 10, 50-40 = 10.... I want to shows these values at least or show these values with the lines in combo chart.

ComboChart1.PNG