Help with a simple boolean example

What I’m trying to do

I am trying to perform a simple boolean operation. I saw this example online and tried to mimic it. I am unable to get it to produce the intended comparison result.

Things I have tried

/* user defined field */
steps:: 999
Goal Reached? ‘= choice(this.steps > 1000, “YES!”, “No, get moving!”)’

I am hoping someone with more experience with data view could offer some guidance here.

Thanks in Advance
-Tim C.

What do you get? And how is it misbehaving for you?

Are you sure you’re using the correct quotes? In the post above you use accent quote character (or possibly the pure apostrophe
character), and not the acute quote character, `.

I got it working:

steps:: 999
Goal Reached? = choice(this.steps > 100, "YES", "NO")

Here is another working example of performing math for folks going down the same path, hope it helps someone:

Voltage:: 1200
Amps:: 25
Distance:: 100
K:: 12.7

Voltage Drop = = round((2 * this.Amps * this.K * this.Distance) / this.Voltage, 1)

These examples use some data view functionality, CHOICE
but as you can see the math works in-line referencing user-defined parameters in the note.

Best Regards
-Tim C.

As they should be when you’re using the correct single quotes…

Yes, agree, thank you for the tip
Best Regards
-Tim C.

For folks referring to this post:

I mis-typed when I wrote the routine is using a DataView function “CHOICE”
That is a standard Obsidian function.
-Tim C.

Errrr “CHOICE” is a Data View function, not a native Obsidian Function

Sorry for the confusion
-Tim C.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.