Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

sum up the sales amount

Hi guys,

I have a table with columns visit_date, sales_date, sales_amount. If I want to sum up the sales amount with sales date larger than visit date, can I use the formula:

SUM({<sales_date={>visit_date}>}sales_amount) ?

Thanks for help!

5 Replies
YoussefBelloum
Champion
Champion

Hi,

try this:

SUM({<sales_date={">$(=max(visit_date))"}>}sales_amount)

wanyunyang
Creator III
Creator III
Author

I mean if there's a record with visit on Jan.1, sales on Jan.2, sum the amount. If another record with visit on Jan.4, sales on Jan.3, don't sum that amount.

YoussefBelloum
Champion
Champion

Yes this expression will do the calculation like what you just described.

did you test it ?

vanand3535
Creator III
Creator III

try this and tell

SUM({<sales_date={">visit_date"}>}sales_amount)

zebhashmi
Specialist
Specialist

SUM({<sales_date={">=visit_date"}>}sales_amount)