Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a field called TimeBand that contains the following data:
> 5y
1m
2 and
3m
3y
4y
5y
6m
12m
1d
7d
1m
2m
3m
6m
1y
2 and
3y
4y
5y
+ 5y
As you can see are periods of time. I need to sort them from minor to major but I do not know how to do it. What I want is for it to look like this: (days, months, years)
1d
7d
1m
2m
3m
6m
12m
1y
2 and
3y
4y
5y
> 5y
Thanks
Try this in "Sort by Expression":
if(wildmatch(Period,'>*'),4,if(wildmatch(Period,'*and'),3,if(wildmatch(Period,'*d'),1,if(wildmatch(Period,'*m'),2,if(wildmatch(Period,'*y'),3,5)))))
Thanks Aron,
the field where I get that data is called 'bucket', do I have to change the word period for bucket?
Yes change the the word period for bucket or whatever the field name is.
Are these bands created in the script? I would suggest using dual function while your create these bands and then you can easily sort on numerically
it is a field that comes like this from an excel.
How is that function you are talking about?
thanks
You can read about Dual here:
Alternatively, you can use Mapping load to assign a numerical value to your field in the script.