Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
Hi
try to look at this qvw file
Thanks, unfortunately I have a personal edition so I cannot open ur qvw!
Hi
try to create two expressions
It doesnt have to be 2 values for year 2011 as in the example above. It could aswell be 4 or 10 values.
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
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
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
Thank you Stefan, that worked like a charm