
Re: Pie Chart with one column and between values
Andrew Mein Mar 4, 2016 7:11 AM (in response to Hatim taj)check out this: Buckets

Re: Pie Chart with one column and between values
balraj ahlawat Mar 4, 2016 7:11 AM (in response to Hatim taj)Create a Bucket Like this and then use that Bucket as a Dimension with required expression?
like?
If(Distance>0 and Distance<=1, dual('<1KM',1),
If(Distance>1 and Distance<=5, dual('<15KM',2),
If(Distance>5 and Distance<=10, dual('<510KM',3)))) as NewDim

Re: Pie Chart with one column and between values
Sangram Reddy Mar 4, 2016 8:07 AM (in response to Hatim taj)Hi Hatimtaj,
There are multiple ways of acheiveing this.
1) You can so it in the script load using an if statement to categorise it.
For time intervals check this:IntervalMatch
2) Use a class() function in the script: https://community.qlikview.com/thread/87214
Thanks,
Sangram.

Re: Pie Chart with one column and between values
Hatim taj Mar 4, 2016 8:23 AM (in response to Sangram Reddy)I have dragged a pie chart on sheet and in dimension added "Distance" and in measure fx I am writing this code
If(Distance>0 and Distance<=1, dual('<1KM',1),
If(Distance>1 and Distance<=5, dual('<15KM',2),
If(Distance>5 and Distance<=10, dual('<510KM',3))))
The result are still not correct. Not sure how to work with a single field values.

Re: Pie Chart with one column and between values
Sangram Reddy Mar 4, 2016 10:23 AM (in response to Hatim taj)Instead you can use this. Would be easier to make buckets:
class(Distance,5) : this will break it into 0 <= x <= 5, 6<= x <= 10 ans so on.
Or else: in your script use this:
If(Distance>0 and Distance<=1, 1,
If(Distance>1 and Distance<=5, 2,
If(Distance>5 and Distance<=10, 3))) as code //in your load statement
Dimmension:
Load * inline [
Code, Desc
1, <1KM
2,<15KM
3, <610KM
];



Re: Pie Chart with one column and between values
JEGAN RAJ Jun 2, 2016 6:40 AM (in response to Hatim taj)Hi Hatimtaj,
I have loaded the values from excel.
u can write like this in editscrpit,
if(Distance>0,if(Distance<=1,' <1 KM',if(Distance>1,if(Distance<=5, '<15 KM','<510 KM')))) as Racelength
and in the Pie Chart
In Dimension Racelength
and in the Expression
Count(if(Racelength>0,if(Racelength<=1,'<1 KM'),if(Racelength>1,if(Racelength<=5, '< 15 KM'),'<510 KM')))

Re: Pie Chart with one column and between values
JEGAN RAJ Jun 2, 2016 6:42 AM (in response to Hatim taj)Hi Hatimtaj,
I have loaded the values from excel.
u can write like this in editscrpit,
if(Distance>0,if(Distance<=1,' <1 KM',if(Distance>1,if(Distance<=5, '<15 KM','<510 KM')))) as Racelength
and in the Pie Chart
In Dimension Racelength
and in the Expression
Count(if(Racelength>0,if(Racelength<=1,'<1 KM'),if(Racelength>1,if(Racelength<=5, '< 15 KM'),'<510 KM')))