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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reference Lines

Hi Qlik heads,

Thank you.

John

1 Reply
swuehl
MVP
MVP

Maybe like this

INPUT:

LOAD ID,

     Date#(Date,'MMM YYYY') as Date,

     Sale,

     Forecast,

     Final

FROM

(ooxml, embedded labels, table is Sheet1);

LOAD *,

  If(previous(ID) <> ID and Sale>0, 1, If(previous(ID) <> ID, 0, Rangesum(Peek(SaleCount), If(Sale>0,1)))) as SaleCount

RESIDENT INPUT

ORDER BY ID, Date desc;

DROP TABLE INPUT; 

ID Avg({<SaleCount = {1,2,3}>}Sale) Stdev({<SaleCount = {1,2,3}>}Sale) upper reference lower reference
5018 13395 18413 -8376
131000202985129810702
240236317
31513283
4261274535-14
5200252452-52