I have a query which will receive a text input based on that it will query data.(The data is like the reviews received for books under one particular genre, say I give my input as romance that will give all those reviews under all books in that genre), But I want to group it based on the book name. So I can get average ratings for a particular book.On grouping , I am getting only names of the book and not the other details. I have attached the required snap of code for it.
In the First pic there is 9 items as output but when I group it the output will be 5 items. I want only the details of 5 items without repetition as in the second pic and I also want to know how to calculate average rating for these books.Please help me out guys!!
Discussion posts and replies are publicly visible
It looks like you're querying from the wrong side. Instead of querying reviews, try querying books and then the reviews for each book. If you use Appian Records, you can easily group data by related fields
Thanks for the reply, I grouped it based on the book_name and I got the avg of the reviews.But I am facing issue in retrieving the rating as icons. The input rating throws error "Cannot index property 'rating' of type String into type List of Variant"
© 2021 Appian. All rights reserved.