| Author |
Message |
Capson
Newbie
Joined: 23 Jan 2013
Location: United States
Online Status: Offline
Posts: 20
|

Topic: Help with Conditional statment Posted: 07 Feb 2013 at 4:42pm |
|
Hello, I have
Table name is 360
Conditional_Client
If {'360_'.Relationsnhip}="Client" then {'360_'.Relationsnhip}
Then make Summery:
Field to Summarize: Conditional_Client
Calculate this Summary: Count
CntClient
If {'360_'.Relationsnhip}="Client" then Count ({@Conditional_Client}, {'360_'.Relationsnhip})
(The Bold is the Summary field)
Finally
Conditional_Score
If {@CntClient}<=2 and {'360_'.Relationship}="Client" then 0
else
{'360_'.Score}
And this works, but.
I have one last problem I REALLY need to change the... then 0 to a hyphen "-" or Null but when I do this I get a error when trying to save the formula
Conditional_Score
If {@CntClient}<=2 and {'360_'.Relationsnhip}="Client" then "-"
else
{'360_'.Score}
I get "A string is required here" and the {'360_'.Score} is hi-lighted but I need the {'360_'.Score} to be there.
So close!!!
Thanks
Edited by Capson - 07 Feb 2013 at 4:43pm
|
IP Logged |
|
|
|
Sastry
Moderator
Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
|

Posted: 08 Feb 2013 at 1:04am |
|
Hi
Instead of giving "-" give 0 some thing like :
Conditional_Score
If {@CntClient}<=2 and {'360_'.Relationsnhip}="Client" then 0 else
{'360_'.Score}
Now right click on the field and go in Format Field--Number Tab--Customize-select again Number tab. You will find one drop down with name "Show Zero Values as :"
Select drop down and choose '-' . It will display '-' when the value is zero 0
|
|
Thanks,
Sastry
|
IP Logged |
|
Capson
Newbie
Joined: 23 Jan 2013
Location: United States
Online Status: Offline
Posts: 20
|

Posted: 08 Feb 2013 at 2:39am |
|
Hello Sastry,
Thank you.
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 08 Feb 2013 at 3:38am |
Another way to do this would be to change the formula: If not ({@CntClient}<=2 and {'360_'.Relationsnhip}="Client") then {'360_'.Score} This will return a null value when the condition is met. -Dell
|
|
|
IP Logged |
|
Capson
Newbie
Joined: 23 Jan 2013
Location: United States
Online Status: Offline
Posts: 20
|

Posted: 08 Feb 2013 at 6:07am |
|
Hello Dell, thanks for your responce.
I tried your formula but dose work, in that the condition is never being met.
I would like to use it if I can be get it to work.
Edited by Capson - 08 Feb 2013 at 6:09am
|
IP Logged |
|
Capson
Newbie
Joined: 23 Jan 2013
Location: United States
Online Status: Offline
Posts: 20
|

Posted: 08 Feb 2013 at 6:16am |
|
Sorry, I refreshed now it is working.
But I do not get a null I still get 0.00
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 08 Feb 2013 at 6:48am |
Did you include the parentheses after the not? Another way to write it would be something like this: If {@CntClient}>2 and {'360_'.Relationsnhip}<>"Client") then {'360_'.Score} -Dell
|
|
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 08 Feb 2013 at 6:52am |
Ok, in the formula you should have an option to set how the formula handles nulls - there are two options: "Exceptions For Nulls" and "Default Values For Nulls". Set it to "Exceptions For Nulls". -Dell
|
|
|
IP Logged |
|
Capson
Newbie
Joined: 23 Jan 2013
Location: United States
Online Status: Offline
Posts: 20
|

Posted: 08 Feb 2013 at 8:53am |
|
Dell, I tried both choices, neither had an effect.
All the brackets are present and accounted for.
I have not tryed the second version of the formula yet I will give it a try as well
Edited by Capson - 08 Feb 2013 at 8:54am
|
IP Logged |
|
Capson
Newbie
Joined: 23 Jan 2013
Location: United States
Online Status: Offline
Posts: 20
|

Posted: 09 Feb 2013 at 10:04am |
|
Here is a solution that uses my original conditional_Score formula.
Create a formula "Null" when the editor opens click close and save with out doing anything
then
Conditional_Score
If {@CntClient}<=2 and {'360_'.Relationship}="Client" then 0
else
{'360_'.Score}
Becomes
Conditional_Score
If {@CntClient}<=2 and {'360_'.Relationship}="Client" then ToNumber{@Null}
else
{'360_'.Score}
This shows null when the condition is met
|
IP Logged |
|
|
|