in sql data blocks you can now indicate conditionals in the form:

--IF=:sort
ORDER BY my_col
--END

The downside is that the IF test only implements null vs not null distinctions. It would be better for sorting conditionals etc to be able to specify case statements in this form:

--SWITCH=:sort
--CASE=code
ORDER BY code
--CASE=total
ORDER BY total
--ELSE
ORDER BY NAME
--END

This would mean that if sort pased a value of code it would sort by the code column, but if it passed a value of total it would sort by the total column, otherwise it would sort by the name column.

CommentFileSizeAuthor
#1 forena_case_statements.patch1.02 KBmetzlerd

Comments

metzlerd’s picture

StatusFileSize
new1.02 KB

Here's a patch for this.

metzlerd’s picture

Status: Active » Fixed

Committed to both dev branches.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.