Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I have a field 'Date' which can have various result codes. I want to count the number of contacts in the last month. My expression is:
sum(if(Date>=$(vMonthBack),if(Result='SMC',1,0),0))
However, this gives me the sum of ALL results, not just SMC, so long as there is one SMC in the last month. i.e. if the last month's result codes are:
SOE, SNC, SMC, SLS, SLM, SNC, the expression returns "5" but if the last month's result codes are
SOE, SNC, SLM, SLM, SNC, SNC the expression returns "0".
What am I missing here?
This is quite difficult to follow without seeing your actual data. Can you attach a qvw with sample data?
I'm pretty sure this would get you more responses.
Mark
It seems that you have 5 rows for 'SMC' so count returns 5.
Add a tablebox and look at your data.