Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mbrouwer
Contributor III
Contributor III

Compare sales life-cycle of articles starting on day one, day two and so on

Every article has it's own Sales starting day on the calendar. To compare the sales life-cycle of articles I want to have a kind of baseline to start displaying sales. On the first day of sales as [day nr]=1 , sales on the second day as [day nr]=2 etc.
No problem so far.
With a normal $Date calendar Qlik will display all day's between the first and last Sales even if there are no facts for that day. This is exactly what I'm looking for with the absolute day numbers 1,2,5,16 etc. But now it's shows gaps in a chart.
Any ideas how to handle this?

image.png

1 Solution

Accepted Solutions
mbrouwer
Contributor III
Contributor III
Author

It's working if you do the following

1) Generate a calendar with absolute daynumbers
2) Set 'Include zero values' at "data handling level". (Not on item level)
3) Optional: Missing values='Show as zeros'  within Appearance
4) Set X-axis on "Use continuous scale"
5) Put boundaries on the absolute daynumbers within the chart so only the first unlit last day with Sales is shown
=if([Day Nr Abs]>=$(=Min({<[AFZT Sales (#)]={">0"}>} [Day Nr Abs])) and [Day Nr Abs] <= $(=Max({<[AFZT Sales (#)]={">0"}>} [Day Nr Abs]))
,[Day Nr Abs],Null())

Result:

mbrouwer_0-1632916062307.png

 

View solution in original post

5 Replies
stevejoyce
Specialist II
Specialist II

What if you try using Alt() function so assign nulls with 0.

 

Alt(sum (Sales), 0)

mbrouwer
Contributor III
Contributor III
Author

I'm still missing the extra days. This won't "generate" extra days between the absolute day numbers. For example Day nr 3, 5 and 6 in my case

juleshartley
Specialist
Specialist

Have you selected Missing values = 'Show as zeroes'

mbrouwer
Contributor III
Contributor III
Author

That's only possible when I generate a calendar with with absolute day numbers. Site effect is that the horizontal axis contains all absolute day numbers.

Small example,  in real will days of many years:
Day_Nr_Abs_Calendar:
load RowNo()-10 as [Day Nr Abs]
AutoGenerate 50;

mbrouwer_0-1632908660946.png

 

mbrouwer
Contributor III
Contributor III
Author

It's working if you do the following

1) Generate a calendar with absolute daynumbers
2) Set 'Include zero values' at "data handling level". (Not on item level)
3) Optional: Missing values='Show as zeros'  within Appearance
4) Set X-axis on "Use continuous scale"
5) Put boundaries on the absolute daynumbers within the chart so only the first unlit last day with Sales is shown
=if([Day Nr Abs]>=$(=Min({<[AFZT Sales (#)]={">0"}>} [Day Nr Abs])) and [Day Nr Abs] <= $(=Max({<[AFZT Sales (#)]={">0"}>} [Day Nr Abs]))
,[Day Nr Abs],Null())

Result:

mbrouwer_0-1632916062307.png