Forum Discussion
CarolineS
Boss
Thanks, TariqHussain! Do you happen to have the code for that? I imagine I could figure it out, but if you've already done it.... 😉
TariqHussain
7 years agoBoss
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
- CarolineS7 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
- 3 months ago