Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I have this bar chart of the number of requests per quarter year.
There is a clear ascending linear trend that I want to visualize with a trend line. The "naive" built-in trendline from Qlik Sense is biased by the incomplete data of the current, incomplete quarter year as shown in the figure. The reasonable thing to do is to base that trend line on the years before YearStart(Today()).
I guess this is a pretty common thing, but I can't figure out how to implement this. Do you have a hint?
What I tried so far:
AggregatedSampleData:
LOAD * INLINE [
Reception Year-Quarter, Count
2021-Q1, 17871
2021-Q2, 17515
2021-Q3, 16443
2021-Q4, 19041
2022-Q1, 19297
2022-Q2, 18020
2022-Q3, 16881
2022-Q4, 19582
2023-Q1, 21232
2023-Q2, 19139
2023-Q3, 18494
2023-Q4, 21002
2024-Q1, 21784
2024-Q2, 1790
];
If anyone is interested: I found the following solution:
Please share sample QVF file to test and explain the outcome.
With my limited rights, it seems I'm not able to export a QVF file.
In the following test data, there's an increase of +1 request per quarter year from one year to the next (total: +4 per year), with within-year variation. The data for the current year is incomplete and results in a wrong linear trend line in the bar chart of Count(RequestID) by [Reception-YearQuarter].
SampleData:
LOAD
RequestID,
ReceptionDate,
Dual(Year(ReceptionDate)&'-Q'&Num(Ceil(Num(Month(ReceptionDate))/3)),QuarterStart(ReceptionDate)) AS [Reception-YearQuarter]
;
LOAD
RequestID,
Date(Date#([Date], 'YYYY-MM-DD') ) AS ReceptionDate,
;
LOAD * INLINE [
RequestID, Date
9, 2022-01-01
10, 2022-01-01
11, 2022-04-01
12, 2022-04-01
13, 2022-04-01
14, 2022-07-01
15, 2022-07-01
16, 2022-07-01
17, 2022-07-01
18, 2022-10-01
19, 2022-10-01
20, 2022-10-01
21, 2023-01-01
22, 2023-01-01
23, 2023-01-01
24, 2023-04-01
25, 2023-04-01
26, 2023-04-01
27, 2023-04-01
28, 2023-07-01
29, 2023-07-01
30, 2023-07-01
31, 2023-07-01
32, 2023-07-01
33, 2023-10-01
34, 2023-10-01
35, 2023-10-01
36, 2023-10-01
37, 2024-01-01
38, 2024-01-01
39, 2024-01-01
40, 2024-01-01
41, 2024-04-01
];
If anyone is interested: I found the following solution:
I have marked your answer as accepted solution.