Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a list box containing dual numbers, they are currently not sorted from smallest to largest.
I would like it to be :
3-9
10-16
17-23
24-30
How can I do this?
Your expression does not create dual values, to do so, you could use:
Dual(
if( month(WeekStart( RE_DAY) )<> month( RE_DAY), 1 , day(WeekStart( RE_DAY) ))
&' - '&
if( month(WeekEnd( RE_DAY) )<> month( RE_DAY), day(RE_DAY) , day(WeekEnd( RE_DAY) )),
if( month(WeekStart( RE_DAY) )<> month( RE_DAY), 1 , day(WeekStart( RE_DAY) ))
)
AS Weeks;
Using ths expression instead, you can simply sort numerically.
hope this helps
regards
Marco
If the are really dual values, the sort should have worked numerically. Can you share a sample qvw?
Hi Tumelo,
You can create the Week number in your script and then, in your Weeks filter order by expression based on your new field.
François
This is the script I use to get the Week values
if( month(WeekStart( RE_DAY) )<> month( RE_DAY), 1 , day(WeekStart( RE_DAY) ))
&' - '&
if( month(WeekEnd( RE_DAY) )<> month( RE_DAY), day(RE_DAY) , day(WeekEnd( RE_DAY) )) AS Weeks;
Hi
You can create a number to relate to the weeks in the script which you can then use in the listbox to sort your week buckets by
Rgds
I tried to do that but some weeks were having the same numbers with different month days.
I wanted it to be like
3-9 Week1
10-16 Week2
17-23 Week3
24-30 Week4 for each month
How can I do this?
Hi Tumelo, Whats in your field named: RE_DAY ? You could sort that if its the underlying day in the listbox>sort tab - otherwise could you send me an example of the above screenshot and I'll create a little lookup table for you.
RE-DAY is a date field
Your expression does not create dual values, to do so, you could use:
Dual(
if( month(WeekStart( RE_DAY) )<> month( RE_DAY), 1 , day(WeekStart( RE_DAY) ))
&' - '&
if( month(WeekEnd( RE_DAY) )<> month( RE_DAY), day(RE_DAY) , day(WeekEnd( RE_DAY) )),
if( month(WeekStart( RE_DAY) )<> month( RE_DAY), 1 , day(WeekStart( RE_DAY) ))
)
AS Weeks;
Using ths expression instead, you can simply sort numerically.
hope this helps
regards
Marco
Tumelo,
Use the WeekName(Re_DAY) as WeekNo function in your script in the same Load statement that youor field Weeks.
Then, you could sort by WeekNo in your listbox (sort Tab).
François