Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning,
I have a simple graph of lines with the sum of field sales, and I see packed with 11 steps and appears perfect.
But there's one problem: they wanted the chart does not begin with first date but after 12 months to avoid the stairs at the beginning of graph.
Any tips?
Thanks,
Gledson
Hello.
I would change the expression to
Count({$<Year={">=$(#=min(Year+1))"}>}Numocorr)
(this is = Count({$<Year={">=$(=2008)"}>}Numocorr))
Hope it helps!
Saludos!
Cristian
Hello currambero,
Thanks, but the problem persist, the effect "stairs" continuous. 😞
Hi,
Please refer the Attached application.
Create a variable as stated in sheet 2 and also refer the variable overview
and check the expression used in chart.
Thanks
Manesh
I was just about to suggest using:
=Count({$<Year={'>2008'}>}Numocorr)
but manesh's solutions it better because you can change the date. Even if you filter out 2008, it looks like your data still "has stairs" in the start of 2009 though. Might have to play with your scale.
I think the simplest would be to move the scale, because when the solutions are good despite the staircase effect still appears, ie the solutions proposed, but the problem is more visual.
Ok, I think I missunderstood your question. You want to calculate accumulative sum twelve month back and not show the first twelve month? Maybe a solution for you is to use a AsOfMonth dimension in your chart.
Br
C
currambero wrote:You want to calculate accumulative sum twelve month back and not show the first twelve month? Maybe a solution for you is to use a AsOfMonth dimension in your chart.
That should work. Just avoid attaching any data to the first 11 months in the AsOf table, and the stairs will go away. See attached example. Script is below. There's undoubtedly a more efficient way to generate the AsOf table. I just coded it the first way that came to mind.
The problem with using the accumulation in the chart itself is that it only accumulates what the chart shows. That means that no matter how much you restrict what shows, you'll never escape the stair problem... I think.
Data:
LOAD
recno() as ID
,date(makedate(2007,1,1)+floor(rand()*1500)) as Date
AUTOGENERATE 100
;
Calendar:
LOAD *
,date(monthstart(Date),'MMM YYYY') as Month
;
LOAD
date(makedate(2007,1,1)+recno()-1) as Date
AUTOGENERATE 1500
;
AsOf:
LOAD distinct Month
RESIDENT Calendar
;
LEFT JOIN (AsOf)
LOAD Month as AsOfMonth
RESIDENT AsOf
;
INNER JOIN (AsOf)
LOAD *
RESIDENT AsOf
WHERE AsOfMonth >= makedate(2007,12,1)
AND Month <= AsOfMonth
AND Month >= addmonths(AsOfMonth,-11)
;