Formulas
Re: Formulas
Another formula question
I'm working with photos/videos. Photos have a date_taken property while videos have a media_created property. This formula puts them into a single column:
add-column:a a:=concat($date-taken:,$media-created:) a-format:datetime
For files that don't have either property set, I'd like to use the modified time. I don't know how to make that happen. I tried using ifdef but wasn't able to get it to work.
By the way, should we just have one thread for all formula questions/help?
I'm working with photos/videos. Photos have a date_taken property while videos have a media_created property. This formula puts them into a single column:
add-column:a a:=concat($date-taken:,$media-created:) a-format:datetime
For files that don't have either property set, I'd like to use the modified time. I don't know how to make that happen. I tried using ifdef but wasn't able to get it to work.
By the way, should we just have one thread for all formula questions/help?
Re: Formulas
Currently, no.Is there a way to set a column to a formula as part of options, so that I don't have to set it in the search bar each time?
Functions and macros might be added in a future release.
For now, please use bookmarks.
I'm working with photos/videos. Photos have a date_taken property while videos have a media_created property. This formula puts them into a single column:
add-column:a a:=concat($date-taken:,$media-created:) a-format:datetime
For files that don't have either property set, I'd like to use the modified time. I don't know how to make that happen. I tried using ifdef but wasn't able to get it to work.
add-column:a a:=$date-taken:?$date-taken::($media-created:?$media-created::$dm:) a-format:datetime
Anywhere in the Everything 1.5 alpha forum is fine.By the way, should we just have one thread for all formula questions/help?
Re: Formulas
Gotcha. I think of the search as separate from formulas and presentation. It would be nice to have the formulas/presentation remain while searching for different thing. Thanks for considering this for the future!
Amazing!add-column:a a:=$date-taken:?$date-taken::($media-created:?$media-created::$dm:) a-format:datetime
Re: Formulas
dear David
please explain function of :: and at which situation is used?
please explain function of :: and at which situation is used?
Re: Formulas
The :: is a coincidence.
This function makes use of a ternary operator
This ternary operator is written as "something?"this":"that" an it translates to : If "something" THEN "this" ELSE "that".
So the following:
$date-taken:?$date-taken::($media-created:?$media-created::$dm:)
can be ttranslated to:
This function makes use of a ternary operator
This ternary operator is written as "something?"this":"that" an it translates to : If "something" THEN "this" ELSE "that".
So the following:
$date-taken:?$date-taken::($media-created:?$media-created::$dm:)
can be ttranslated to:
Code: Select all
IF date-taken exists
THEN
value is date-taken
ELSE
IF media-created exists
THEN
value is media-created
ELSE
value is date-modified
Re: Formulas
Quick follow up question. I can filter datetaken, mediacreated or datemodified individually using dd/MM/yyyy syntax. But with columna as defined above, I'm no longer able to use that syntax. I think it forces me to use the epoch timestamp. Is there a trick to getting dd/MM/yyyy to work as a filter there?
On a completely separate topic, I've been getting 403 errors intermittently while trying to browse different threads in the forum. Even with different browsers and/or incognito mode.
On a completely separate topic, I've been getting 403 errors intermittently while trying to browse different threads in the forum. Even with different browsers and/or incognito mode.
Re: Formulas
Custom columns are currently treated as text.
Please use formulas to filter by dates.
For example:
Adding type support to formulas is on my TODO list.
For example: date-taken:?$date-taken::($media-created:?$media-created::$dm:) returns a date value.
There was a few blocks for certain user agents under certain conditions.
There are a lot of bad actors hitting this site.
I have temporarily removed some of these blocks.
Please let me know if you see any more 403 errors.
Please use formulas to filter by dates.
For example:
DATEVALUE($a:)>=DATE(2023,1,1) DATEVALUE($a:)<=DATE(2023,12,31)
Adding type support to formulas is on my TODO list.
For example: date-taken:?$date-taken::($media-created:?$media-created::$dm:) returns a date value.
There was a few blocks for certain user agents under certain conditions.
There are a lot of bad actors hitting this site.
I have temporarily removed some of these blocks.
Please let me know if you see any more 403 errors.
Re: Formulas
Awesome, appreciate the tip and considering changing the type in the future!
Still getting 403s on my Mac. PC and iPhone are ok.
Still getting 403s on my Mac. PC and iPhone are ok.