Saiku: How to use boolean fields from the database?

  • Asked
  • Active
  • Viewed 8936 times
0

Hi support, in my Collect database I have some boolean fields (e.g. whether a sample point belongs to a certain special management or not). These boolean fields don't show up in Saiku, but I need them as filters. How to get them there? Do I need to define a category for that? A small example code would help me a lot.

This question is marked "community wiki".
0

Accepted answer

Hi. In Calc, I got (computed) boolean variable to Saiku, works quite similarly with boolean fields:

1) create category:
0='no', 1='yes'

2) R script: tree$tree_is_alive <- ifelse( tree$tree_health ==5, 0, 1 )


Regards, Lauri

0

Accepted answer

Hi Lutz,

Thanks Lauri for your answer and for posting some sample code!

Boolean fields are not supported by Calc, you should instead use a category with two possible values (Yes/No) when you collect your data, or as Lauri suggested, you can create a new calculation step type category in Calc.

Please let us know if you need more info.

Regards,

Mino

0

Accepted answer

Hi Lauri and Mino,

thanks you for the example, it helped me a lot. Seems to work fine! Lutz

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.