Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
christela
Contributor II
Contributor II

Sum of two points in a line chart

Hi,

I have a problem with a line chart that I didn´t think should be so difficult but I can´t seem to make it work. I will try to explain....

I have a table like this:

datevalue
2019-01-01A
2019-01-01A
2019-01-01B
2018-12-01C
2018-12-01B
2018-11-01A
2018-11-01B
2018-11-01D
2018-10-01E
2018-09-01A
2018-09-01B
2018-09-01C

 

I want to calculate the number of distinct values in each Date like this....:

DateNrOfDistinctValues
2019-01-012
2018-12-012
2018-11-013
2018-10-011
2018-09-013

 

and then I want to plot out the sum of two dates, the date on the row and 2 rows below, and dived it by 2  in a line chart. The x-axis is Date and the value on the dot should be like this. I actually want the sum to be between one date and 12 months earlier, but I don´t want to do such a big table).

Date Value on dot
2019-01-01The value of date( 2019-01-01 + 2018-11-01)/2  (eg 2+3/2)2,5
2018-12-01The value of date( 2018-12-01 + 2018-10-01)/2  (eg 2+1/2)1,5
2018-11-01The value of date( 2018-11-01 + 2018-09-01)/2  (eg 3+3/2)3

 

Is this possible? And if so: How do I do this?

1 Solution

Accepted Solutions
christela
Contributor II
Contributor II
Author

Problem solved. I used the wrong date in the line chart. I´m using AsOf-table

View solution in original post

3 Replies
iswarya
Partner - Creator
Partner - Creator

 to calculate the number of distinct values in each Date:

Create a table 

Dimension: Date

Measure: Count(Distinct value)

christela
Contributor II
Contributor II
Author

That is not the problem. I know how to calculate the distinct value, but the problem is the last piece where I want to have the average between to dates in a line chart

christela
Contributor II
Contributor II
Author

Problem solved. I used the wrong date in the line chart. I´m using AsOf-table