Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I have data from a SQL DB that looks similar to this:
id | reported status | actual status |
1 | success | success |
1 | fail | success |
2 | undetermined | undetermined |
3 | undetermined | success |
3 | - | fail |
3 | fail | fail |
I'm trying to count the number rows that have reported status != actual status . I have this as my equation:
Count ({<[reported status] -={"=[actual status]"}>} id). However, this is giving me a count that is too high, compared to when I check it in the SQL database. If I do unique id, I get a lower number but it isn't the right count either.
Perhaps this?
Count ({<id = {"=[reported status]<>[actual status]"}>} id)
This probably is not the most efficient way to accomplish, but should return the correct results.
count(if(reported_status<>actual_status,id))
try below
sum(if(reported status <> actual status, Aggr(Distinct(id),reported status ,actual status)) )
With the above sample data your excepting the output count to be 2 or 4
why is a sum?