mercredi 27 octobre 2021

AWS quicksight calculations - How to use sum or sumif in an "ifelse" aggregations

I am using AWS quicksight and having troubles calculating a field in a table. i need to use an "ifelse" aggregation where the "if" and "else" are sums of other fields in the table. i keep getting the following error and dont understand how to overcome:

"mismatched aggregation, custom aggregations cant contain both aggregate SUM and non - aggregated fields"

code exmaple:

'''ifelse(
({calculated field} = "Won"),(sumIf({amount},(({field}="Won"))
))
,({calculated field} = "Not Final"),({sum_amount_2})
,1
)'''

thanks.

Aucun commentaire:

Enregistrer un commentaire