Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
d_prashanthredd
Creator III
Creator III

Define a range on Axes

Hi Experts,

I have a requirement to build a bar chart or any.

Requirement: Define a range on x-axis i.e. sum(value) for 0-199, 200-399, 400-599, 600-799, 800+

And that should be in an expression rather than in a script.

Note: I have fixed ranges.

Please find the attached qvd and the data is sample.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You should use expression like below.

=Aggr(if(sum(Value) >= 0 and sum(Value) < 200, '0-200',

if(sum(Value) >= 200 and sum(Value) < 400, '200-400',

if(sum(Value) >= 400 and sum(Value) < 600, '400-600',

if(sum(Value) >= 600 and sum(Value) < 800, '600-800', '800+')

)

)

),Field,SubField)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You should use expression like below.

=Aggr(if(sum(Value) >= 0 and sum(Value) < 200, '0-200',

if(sum(Value) >= 200 and sum(Value) < 400, '200-400',

if(sum(Value) >= 400 and sum(Value) < 600, '400-600',

if(sum(Value) >= 600 and sum(Value) < 800, '600-800', '800+')

)

)

),Field,SubField)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
d_prashanthredd
Creator III
Creator III
Author

Hi Kaushik.. Its working fine.

I missed aggr function.. Thanks a lot.