Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to set an indicator based on values in a field. I have tried all of the following with no luck. Any ideas?
Thanks
Thom
If (IsNull(KVGR4),1,0) as Organic
If Len(KVGR4 > 0,1,0) as Organic
If (Len(Trim(KVGR4) > 0),1,0) as Organic
Thanks everyone for your responses, but finally got it to work using this: IsNum([Customer Acquisition]) as Organic. It made the field either 0 or -1.
Hi Thom,
I may be missing something but there is one closing parenthesis missing in your code:
If(Len(Trim(KVGR4)), 1, 0) AS ORGANIC // 0 is false, otherwise true
Are you using some script variables or NULLASNULL, NULLDISPLAY statements in your code?
Hope that helps.
Miguel
What value are you getting from the len and isnull without the if?
I have not tried it without the if.
Nope....
The syntax should look like this:
If(Len(KVGR4) > 0,1,0) as Organic
Here is the statement I am using: If(Len([Customer Acquisition]) > 0,1,0) as Organic Organic is always a 1.
Hi,
Can you explain about what you trying to achieve?
Celambarasan
I want to separate my customers between Organic and Accquired.
Do you always get 0 when you use this statement?
If (IsNull([Customer Acquisition]),1,0) as Organic
If so, this would imply there is data in each cell. In that case, the following should work.
If (Len(Trim([Customer Acquisition]) > 0),1,0) as Organic.
You could try running some SQL statements directly to see if the results mimic what you're seeing in QV.