Add results from two different queries in different collections.

I have two different queries.
query1 for collectionA
query2 for collectionB
Each query sums up the amount in filtered results.

I need to add the TotalSum of each queries.

Everytime the result I get is Nam.
Please help how can I get the result I need. Thanks.

Hello,

You should try using getTotalCount() for two datasets and just sum these values.

https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#getTotalCount

There are also related forum posts that should help you start:
https://www.wix.com/corvid/forum/community-discussion/total-count-of-filtered-search-result
https://www.wix.com/corvid/forum/community-discussion/solved-counting-items-repeater-filtered
https://www.wix.com/corvid/forum/community-discussion/count-number-of-filtered-items

Thanks @Anastasiia but I’m not counting the rows in filtered results, I’, counting the total in “Amount” field of each datasets. Sorry I wasn’t clear.
I get already the result I needed in my 2 queries, the total Amount. However I can’t add the two results.

query1 for collectionA - > result : collectionATotalAmount
query2 for collectionB - > result : collectionBTotalAmount

My problem is when I add “collectionATotalAmount” and “collectionBTotalAmount” result is “NaM”. I can’t add or subtract.

In console, I expected this result :
displays :
collectionATotalAmount
collectionBTotalAmount
TotalSumOfTwoCollectionsAmount
Ex:
1000
500
1500

However, this is what I got.
NaM
1000
500

It’s like it adds already even if the two queries haven’t calculated the result yet, that’s why its “NaM”

@mariannepenanueva did you figure it out? I’m trying to do the same thing!