Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
swuehl
MVP
MVP

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

View solution in original post

8 Replies
Not applicable
Author

Hi

try to look at this qvw file

Not applicable
Author

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

Not applicable
Author

Hi

try to create two expressions

Not applicable
Author

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

swuehl
MVP
MVP

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
Author

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

swuehl
MVP
MVP

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
Author

Thank you Stefan, that worked like a charm