Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Linear Trend Line (QS) despite of date gaps

Hi all,

I am trying to add a trend line based on linear regression to my chart (have tried using both a line graph and a combo chart).

My dimension is a date field, but there are gaps, as I don't have data on all dates.

I have tried inserting a trend line using:

linest_m(total aggr(Y,X), X)*X + linest_b(total aggr(Y,X),X)

This, however, leaves me with a "broken" trend line because of the gaps in my dates.

I have tried to change my dimension into consecutive numbers using =aggr(rank(-DATEFIELD),DATEFIELD)-1

Changing the dimension works fine itself, but unfortunately it doesn't help me creating my trend line. I have also tried replacing my datefield in my expression with the above aggr-expression.

Any help would be appreciated.

1 Reply
Contributor II
Contributor II

I still haven't found a solution to this, so any help would (still) be appreciated