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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SOLVED - Start of graph

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

8 Replies
Not applicable
Author

Hello.

I would change the expression to

Count({$<Year={">=$(#=min(Year+1))"}>}Numocorr)

(this is = Count({$<Year={">=$(=2008)"}>}Numocorr))

Hope it helps!

Saludos!

Cristian

Not applicable
Author

Hello currambero,

Thanks, but the problem persist, the effect "stairs" continuous. 😞

maneshkhottcpl
Partner - Creator III
Partner - Creator III

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

Not applicable
Author

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.

Not applicable
Author

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.


Not applicable
Author

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

johnw
Champion III
Champion III


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)
;

Not applicable
Author

Thanks John Witherspoon

Works fine!

hugs.

Gledson