11 Replies Latest reply on Jul 20, 2018 9:39 AM by Jessica Wren

# Creating an IF statement

Hello, I am working on a project that contains application names, server names, and if that server is protected/ unprotected.

A lot of applications have multiple servers. If one server is unprotected, the whole application is considered unprotected.

Example: Application XYZ has 10 servers. 9 servers are protected, 1 is unprotected. Therefore, Application XYZ is unprotected.

How do I create a calculated field that says the application is unprotected.

I have been trying things like

IF server contains ([protectionstatus], "Not Protected")

THEN application = "Not Protected"

END

I am not allowed to post the excel sheet because it confidential to my work, but I can make fake one if necessary.

• ###### 1. Re: Creating an IF statement

The easiest way to do this is to have your data source contain a measure called [Server Unprotected] where protected=0 and unprotected=1.

Then you can do sum([Server Unprotected])>0 and set that to true.

I don't know what your data looks like, if Protected/Unprotected are both string values you can create a CASE/WHEN statement where "Unprotected=1" and then do a sum off the 2nd calculation, but of course additional calculations will make your dashboard run slower so it depends on how frequently this dashboard will be used.

• ###### 2. Re: Creating an IF statement

That is a great idea! However, we can not sum the 1 and 0's by application name because there are so many and not all of them have the number of hosts.

• ###### 3. Re: Creating an IF statement

Hi Jessica,

I don't understand why not having the same number of hosts is the problem - don't you just want to see if at least 1 is unprotected per group? If so, a boolean that flags every application with a number greater than "Null" will all be set to True

• ###### 4. Re: Creating an IF statement

You are correct, one unprotected server is enough to render the whole application unprotected.

But how do I display the application name only once with end result of protected/unprotected?

• ###### 5. Re: Creating an IF statement

Hi Jessica,

You can create a conditional set using the data:

Find your application dimension, go to Create Set, and in the Set go to Condition tab and filter for By field: sum([Server Unprotected])>0

Then you've got that as a set

• ###### 6. Re: Creating an IF statement

Hi Jessica,

Use the below calculation to identify the protected or not protected application name

BR,

NB

1 of 1 people found this helpful
• ###### 7. Re: Creating an IF statement

Maybe you can try this way ,I wish you can understand what i did with the step 1,2,3.

thank you for your time .

Result:

and you can also mixed the three LODs into one. Try it.

• ###### 8. Re: Creating an IF statement

Hi Jessica,

As i seen your data if your Protection Status contain only two values like Protected & Not Protected then you can get your result by using simple calculation -

Regards,

Aman

• ###### 9. Re: Creating an IF statement

Thank you so much!!

• ###### 10. Re: Creating an IF statement

Thank you!

• ###### 11. Re: Creating an IF statement

Thank you! I really appreciate it. This is the one my team ultimately used.