Is it possible to count the number of occurrences of a calculated field's result in Tableau? -


i have function categorizes calls user has made 3 categories using calculation:

    if 0 <= datediff('dayofyear', [submitteddatetime], [calldate])      , datediff('dayofyear', [submitteddatetime], [calldate]) <= 7      "week after"     elseif -7 <= datediff('dayofyear', [submitteddatetime], [calldate])      , datediff('dayofyear', [submitteddatetime], [calldate]) < 0     "week before"     else "not within week"     end 

i wondering if it's possible count number of occurrences of particular outcome of function on per user basis in order categorize each user based off of number of occurrences. i'm attempting use calculation so:

    if { fixed [subid]: count([datediff calc] = 'week after')} = 1     "1 conference user"     elseif { fixed [subid]: count([datediff calc] = 'week after') } > 1     "multiple conference user"     else "0 conference user"     end 

but count function i'm using not working seems. seems count function counting occurrences of both "week before" , "not within week" first function.

i think problem measure part of lod expression :

 count([datediff calc] = 'week after') 

this give count of both times: when conditions met , when not met. [datediff calc] = 'week after' return true or false, both counted +1 in count function.

you try like:

if { fixed [subid]: sum(if[datediff calc] = 'week after' 1 else 0 end)} = 1  "1 conference user"  ... 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -