Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Chart: instead of grouping per x-axis show the xaxis-label multiple times?

Hello, consider a chart with time as x-axis. For simplicity the following:

  |

  |

  |

  |   

  |   

  |__value____value____value___..

       2011        2012       2013

If I have two values for 2011 i cannot just use "value" as expression for the chart, instead I have to use some kind of aggregation like sum or avg. What I'd rather have is the following:

  |

  |

  |

  |   

  |   

  |__value1____value2____value____value____..

      2011          2011       2012         2013

In other words, having the label on x-axis repeating itself for each new value that corresponds to that point on the x-axis.

Is this possible, if so how?

thank you

1 Solution

Accepted Solutions
MVP
MVP

Re: Chart: instead of grouping per x-axis show the xaxis-label multiple times?

The idea is that you assign all records that you want to group together the same unique number. If you don't want any record to be grouped together, assign a primary key, e.g. recno():

LOAD *,

dual(year, recno() ) as Newdim

INLINE [

    year, value, month

    2011, 2, jan

    2011, 3, feb

    2012, 5, feb

    2012, 4, feb

];

Create a new chart with dimension Newdim and just field value as expression (without the need for an aggregation). I hope that's what you want.

Stefan

8 Replies
Not applicable

Re: Chart: instead of grouping per x-axis show the xaxis-label multiple times?

Hi

try to look at this qvw file

Not applicable

Re: Chart: instead of grouping per x-axis show the xaxis-label multiple times?

Thanks, unfortunately I have a personal edition so I cannot open ur qvw!

Not applicable

Re: Chart: instead of grouping per x-axis show the xaxis-label multiple times?

Hi

try to create two expressions

Not applicable

Re: Chart: instead of grouping per x-axis show the xaxis-label multiple times?

It doesnt have to be 2 values for year 2011 as in the example above. It could aswell be 4 or 10 values.

MVP
MVP

Re: Chart: instead of grouping per x-axis show the xaxis-label multiple times?

QlikView will bei default only show your dimension values once. I think you can get what you want, if you create a dual value, so you display a common text value, but the dimension values differ by their numerical value.

For example:

LOAD *,

dual(year,autonumber(year&month)) as Newdim

INLINE [

    year, a, month

    2011, 2, jan

    2011, 5, feb

    2012, 5, feb

    2012, 5, feb

];

If you use Newdim as dimension and sum(a) as expression, 2011 will be repeated (because the combination of year and month differ), but 2012 not.

See also attached,

Stefan

Not applicable

Re: Chart: instead of grouping per x-axis show the xaxis-label multiple times?

Hello, thanks. If I understand the concept that requires that the two values for year 2011 belongs to two different months? What happens if the values belongs to same year, same month and even same day?

Having a personal edition I cannot open ur file

MVP
MVP

Re: Chart: instead of grouping per x-axis show the xaxis-label multiple times?

The idea is that you assign all records that you want to group together the same unique number. If you don't want any record to be grouped together, assign a primary key, e.g. recno():

LOAD *,

dual(year, recno() ) as Newdim

INLINE [

    year, value, month

    2011, 2, jan

    2011, 3, feb

    2012, 5, feb

    2012, 4, feb

];

Create a new chart with dimension Newdim and just field value as expression (without the need for an aggregation). I hope that's what you want.

Stefan

Not applicable

Re: Chart: instead of grouping per x-axis show the xaxis-label multiple times?

Thank you Stefan, that worked like a charm

Community Browser