I have a list of profiles in the caseDB which have a case property called profile_creation_date_time = double(now()) this is just a hidden value when a profile is created.
When showing a list of profiles from the caseDB I would like the latest created profile to display as the first item in the list. The problem is that the Sort field by default sorts by ascending and I need it to sort descending. Is there any way to do this?
Thanks so much for the response. I gave that a try see pic below and it didnt like that.
Doesnt seem to like that second parameter in the sort field.
Was that what you were thinking of or did you have something different in mind? Wondering if Im following your idea properly.
you want to
1- make a hidden calc called something like profile_creation_sort
2- put something like this int(profile_creation_datetime property ) * -1
3- store as a property
4- use that property as a sort
basically convert the date to a number
multiple by -1 to make it a negative value
use it in sort - sorting from a negative value will look like descending
How I need it to be sorted
name: SortValue
03 Tazz Test: -19832.554162939814
02 Tazz Test: -19832.553663425926
01 Tazz Test: -19832.552888703704
I think the reason its not sorting it how we expect it to is because its not reading the sort value case property as a number but rather as a string, so the "-" negative sign has no affect.
I see. I think that for some reason it is not recognizing that these are numbers.
you are correct, it would round those values and you would lose the time resolution
double should also work in theory but it might be treating them differently internally - double as string perhaps. I have sorted negative numbers correctly before I'm pretty sure. so it must be treating it as a string some how
I gave it a try but no luck. Ready to give up on this now. haha
So I tried to remove the decimal point with a replace function and the convert the string to an int. What I ended up with was an empty case property.
19835.37405318287 became '' [Only thing I can think of is it cant handle an int that size, unless my function is not working correctly.]
Function I used below..
I am still convinced that it's treating those numbers as text.
try passing that property through the "number()" function instead of int or double.
if that doesn't work then...
honestly, I would ask support for any tips to change the sort order in lookup table multiple choice questions.
if not available, try this
calculate the difference in days
calculate the difference in minutes from "now"
now you have two smaller figures to work with.
stick them together
sort by those
you want to have the smallest number first, giving you the latest case on top.
remember to pad zeros so that 1 and 10 don't show up right after each other