Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have created a bar chart with price. i want to create a listbox price range as a filter. Can anyone out there help help??
I need to have a price range
<1000
1001 - 2000
2001-3000
3001-5000
>5000
how can i do that? should i do it in back end script?
Rgds
Jim
You can create the field in backend.
If (FieldName <1000,'<1000',
if(FieldName <= 2000,'1001 - 2000',
if(FieldName <= 3000 ,'2001-3000',
if(FieldName <= 5000,'3001-5000', '>5000')))) as [Price Range],
Tamil, there are errors when i added in your if statement.
I have attached a sample file.
Hi Jim,
Please check the attached file.
Hi Jim,
Please use the below link.
http://community.qlik.com/blogs/qlikviewdesignblog/2014/07/14/buckets
the sum of the bar chart actually not so easy....i am thinking to write it in variable.
so .. on the load script
i created
let vSum = sum(price)*100/0.5;
Table1:
load*,
if (($(vSum))<1000 ,'<1000',
if (($(vSum))<= 2000,'1001 - 2000',
if (($(vSum))<= 5000, '>5000'))) as [Price Range]
from....
I got error on my If statements.. did i write it wrong?
Rgds,
Jim
Try something like,
Data:
Load Chart,
Sum(Price)*100/5 as Sales Group by Chart;
LOAD * INLINE [
Chart, Price
BAR A, 1000
BAR A, 1000
BAR A, 1000
BAR B, 2000
BAR C, 3000
BAR D , 4000
BAR E, 5000
BAR F, 6000
];
Final:
Load * ,
If ( Sales*100/5 <1000 ,'<1000',
if( Sales*100/5 <= 2000 ,'1001 - 2000',
if(Sales <= 3000 ,'2001-3000',
if( Sales,'3001-5000', '>5000')))) as [Price Range]
Resident Data;
Drop Table Data;
Or you can simply try list box expression in front end.
If ( Sum(Price)*100/5 <1000 ,'<1000',
if( Sum(Price)*100/5 *100/5 <= 2000 ,'1001 - 2000',
if(Sum(Price)*100/5 <= 3000 ,'2001-3000',
if( Sum(Price)*100/5,'3001-5000', '>5000'))))