Forum Discussion
TariqHussain
Boss
Threads top viewed all the time.
SELECT * FROM messages where depth = 0 ORDER BY metrics.views DESC
For threads posted in one month and sorted by most views
SELECT * FROM messages where post_time > timestamp AND depth = 0 ORDER BY metrics.views DESC
The timestamp will for 30 days before time.
As I mentioned above this will give you messages which is posted within last month and sorted by date views. But not get message top viewed in last 30 days (could be posted before 30 days but viewed most in last 30 days)
Documentation: https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv2&collection=messages#constraints-post_time
CarolineS
7 years agoBoss
You're the best, thanks! Now I just need to figure out how to display it nicely in a component :-)
Related Content
- 4 years agoInactive User
- 5 months ago