I am using LIST_OBS in a dynamic Listbox but it adds a period to the end of the last item.I cannot use replacestr to remove periods because the user can enter periods.
Here is what I have in my dynamic listbox:
{LIST_OBS("HPI","Signed","Comma","Value")}
And it turns out like this:
The patient is here for their knee.
The patient is here for their shoulder.
The patient is here for their ankle..
Does anyone know how to strip out that last period????
If you are sure you will only ever have one ".." then use this:
{replacestr(LIST_OBS(“HPI”,”Signed”,”Comma”,”Value”),"..",".")}
Hi Ken,
David's response is about all you can do without some extra coding complicating things and expending resources better spent elsewhere. LIST_OBS itself does not add a period to the end of the returned values, so it must be part of an actual obsterm value being returned The user entered an extra period). Aside from manually correcting the entry, replacestr is your best option.
Correction: I note that you are using the 'comma version' of list_obs. This DOES add a period at the end of the list (why is beyond my reasoning skills), making David's solution about your only option unless you use list or delimited formats which do NOT add the comma.
Thank you. I ended up creating a function to accomplish this. Turns out that the list version of this MEL utility function also adds 2 spaces to the end...shrug...
so I ended up using remove(list_obs("HPI","signed","comma","value"),size(list_obs("HPI","signed","comma","value"))-2,3)