19 Replies Latest reply: May 24, 2016 11:21 AM by Stefan Wühl

# Limit dimension in aggregated chart

Hi.

I have such a strange problem:

I have aggregated chart (rangesum above fo months from the begining of data till now) and it is ok. But I need to see only last 12 months of it.

I cannot limit dimension for top 12 (months) becouse I need calculate all months.

Screens below. I hope anybody can help.

And if I limit this chart with dimension settings or set expression I will only get calculated last 12 months which is wrong.

• ###### Re: Limit dimension in aggregated chart

I am able to get the line chart for the part needed, but not able to remove the dates from axis:

May be reddys310 can help

UPDATE: Expression used:

RangeSum(Above(Sum({<[Year-Month]>}Value), 0, RowNo())) *

Avg({<[Year-Month] = {"\$(='>=' & Date(AddMonths(Max([Year-Month]), -12), 'YYYY-MM') & '<=' & Date(AddMonths(Max([Year-Month]), 0), 'YYYY-MM'))"}>}1)

• ###### Re: Limit dimension in aggregated chart

Sunny, looks quite fine just opening your QVF:

I think I am using QS 2.1.1 still...

• ###### Re: Limit dimension in aggregated chart

Strange, I am using this:

• ###### Re: Limit dimension in aggregated chart

Sunny, can you open and have a look at this sample?

As an alternative approach, the OP could use an AsOf table:

The As-Of Table

• ###### Re: Limit dimension in aggregated chart

This one looks good

• ###### Re: Limit dimension in aggregated chart

@swuehl. I knew that your solution won't be easy for me. I'm not into set expression, so could you explain me what have you done with this calculation step by step? Especially with set expression. Don't hesitete to write here or (maybe more convenient mail klewandowski@solemis.com)

Only(

{<[Year-Month] = {"\$(='>=' & Date(AddMonths(Max([Year-Month]), -12), 'YYYY-MM') & '<=' & Date(AddMonths(Max([Year-Month]), 0), 'YYYY-MM'))"}>}

Aggr( RangeSum(Above(Sum({<[Year-Month]>}Value), 0, RowNo()))

,([Year-Month], (NUMERIC, ASCENDING) )

)

)

• ###### Re: Limit dimension in aggregated chart

Perhaps, I am using Sense 2.2 and I see as Sunny

• ###### Re: Limit dimension in aggregated chart

Hi Sunny and Kamil,

You can use this to remove the dates from the axis:

Thanks,

Sangram.

• ###### Re: Limit dimension in aggregated chart

I knew it. I knew you won't disappoint me with a Qlik Sense question sangram. You are my go to man when it comes to Qlik Sense . Thank you for your response.

• ###### Re: Limit dimension in aggregated chart

Hi Sunny,

Thank you so much for your kind words, but frankly speaking I am getting to learn a lot from your contributions in the community and good work. I should be the one thanking you.

• ###### Re: Limit dimension in aggregated chart

But Sangram doing that just removes the axis labels. It still is squished to the right

Why would it not show only those months where we are showing the data?

• ###### Re: Limit dimension in aggregated chart

Especially that date labels are needed

• ###### Re: Limit dimension in aggregated chart

Hi Sunny,

In that case you can hide them, if you go to the add-ons panel in the properties of the line chart, you can uncheck the show zero values and they should be gone.

• ###### Re: Limit dimension in aggregated chart

I already did that, and it is not going away for some reason

• ###### Re: Limit dimension in aggregated chart

Hi Sunny,

I believe its because of the table calculations which are being performed (Range sum) . There might be original values but the calculated ones are showing nulls and these are not being interpreted by the visualization.

Can we do the calculation in the data model itself?

Thanks,

Sangram.