Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi have a data like
Name | Days |
A | 6 |
B | 7 |
C | 8 |
D | 12 |
E | 16 |
F | 25 |
G | 26 |
H | 28 |
I | 16 |
G | 35 |
H | 26 |
I wnat the structure like this
i want this type of dimension in my chart , count of those who like in the range .
To create buckets you can use the class function in your dimension:
=Class(Days, 10, '-')
or you can do it in the script also:
Class(Days, 10, '-') as Buckets
How can you please explain in detail
Try this script:
Table:
LOAD *,
Replace(Replace(Class(Days, 10, '-'), '<=', ''), '<', '') as Bucket;
LOAD Name,
Days
FROM
[https://community.qlik.com/thread/164893]
(html, codepage is 1252, embedded labels, table is @1);
Output:
Hi,
another solution could be:
LOAD *,
Dual(Replace(Class(Days,10),'<= x <','-'),Class(Days,10)) as DaysClass
FROM [https://community.qlik.com/thread/164893] (html, codepage is 1252, embedded labels, table is @1);
this way the DaysClass field will be dual, i.e. it will be numericaly sortable.
hope this helps
regards
Marco