8 Replies Latest reply on Aug 8, 2016 11:17 PM by Ashish Chaudhari

# Assistance required with a “Conditional Calculated Field”

Hi All,

I would appreciate any assistance with compiling a conditional calculated field to determining the following,

Logic:

• I have already determined the calculated field for “Shearer Cutting”, if the criteria is not satisfied then the shearer is determined to be Stationary, therefore not cutting
• I am also attempting to include the “Shearer Cutting” logic to determine “Shearer Cutting Direction” based on “Three Conditions / Criteria”

Require:

• I need the “Shearer Cutting Direction” Triangle Shape to have three orientations based on the following criteria, namely:

1. If the “ShearerDirection”  = L and “Shearer Cutting” condition has been satisfied, then the shearer is considered to be cutting to MG, the triangle should be pointing “Down”

2. If the “ShearerDirection”  = R and “Shearer Cutting” condition has been satisfied, then the shearer is considered to be cutting to TG, the triangle should be pointing “Up”

3. If the “ShearerDirection”  = L or R and “Shearer Cutting” condition has NOT been satisfied, then the shearer is considered to be Stationary, the triangle should now be pointing “Horizontal” sharp end to the right

Note!

• My workbook is attached

Any guidance will be most appreciated,

Cheers,

Lance

• ###### 1. Re: Assistance required with a “Conditional Calculated Field”

Shearer Cutting Direction

IF [Shearer Direction]="L" and [Shearer Cutting]=TRUE THEN 'MG'

ELSEIF [Shearer Direction]="R" and [Shearer Cutting]=TRUE  THEN 'TG'

ELSEIF ([Shearer Direction]="L" or [Shearer Direction]="R") and [Shearer Cutting]=FALSE  THEN 'Not Satisfied'

END

Please refer to the screenshot for reference and confirm the output.

Let me know if that helps.

Thanks and Regards,

Ashish Chaudhari

1 of 1 people found this helpful
• ###### 2. Re: Assistance required with a “Conditional Calculated Field”

Please find the attached workbook for reference.

-Ashish

1 of 1 people found this helpful
• ###### 3. Re: Assistance required with a “Conditional Calculated Field”

Hi Ashish,

Thanx for the “Shearer Cutting Direction” calculation you were spot on mate,

I did a quick logic test “Raw data vs. what the viz displays” and realised my “Shearer Cutting” calculation I configured is not true every time,

I would appreciate it if you can take a look please?

Error Example:

• Raw Data string

• My “Shearer Cutting” calculated field  [Shearer Speed] >=4.4 and ([LH Cutter Amps] >=50 or [RH Cutter Amps] >=50)

• You will notice that for the raw data string, the LH and RH Cutter Amps are not >=50, but the Shearer Speed is > = 4.4 (29.7)

• The way I was reasoning was that “Shearer Cutting” if Both Shearer speed and Cutters are greater than the measures in the formula, I just realised that as in this case the cutters are < 50 but the shearer is still moving at high speed > = 4.4 (29.7)

• Is there a way to redo my “Shearer Cutting” calculated field as follows:
• If [Shearer Speed] >=4.4 and ([LH Cutter Amps] >=50 or [RH Cutter Amps] >=50) then the “Shearer is Cutting”
• If [Shearer Speed] >=4.4 and ([LH Cutter Amps] <=50 or [RH Cutter Amps] <=50) then the “Shearer is Flitting”

Not sure how this will influence the “Shearer Cutting Direction” calculation you configured earlier?

Thanx again for the support Ashish!

Lance

• ###### 4. Re: Assistance required with a “Conditional Calculated Field”

Hi Lance,

It did affect the Shearer Cutting Direction calculation. Let try to fix first part where you are trying to redefine the Shearer Cutting calculation first. Once you approve if below calc works for you then we can go ahead defining the direction of the same.

Check this one and let me know if this helps.

if (([Shearer Speed] >=4.4 and ([LH Cutter Amps] >=50) or [RH Cutter Amps] >=50)) = TRUE then "Shearer is Cutting"

ELSEIF  ([Shearer Speed] >=4.4 and ([LH Cutter Amps] <=50 or [RH Cutter Amps] <=50)) = TRUE then "Shearer is Flitting"

ELSE "No Condition, That why Null (No Futher Categorisation)"

END

As you can see the last else condition I have write as No condition bla bla. This is because there are few other conditions that lies in your data which are not covered in the this calculation. For all those rows it is returning "Null" value.

If possible let me know if there are any other conditions so that we can avoid "NULL"

After putting this calculation to the filter section, you will get below selection options as suggested by you.

Try the above calc and let me know if it works for you or not. If needed we can modify the same as per what is exactly required.

-Ashish

1 of 1 people found this helpful
• ###### 5. Re: Assistance required with a “Conditional Calculated Field”

Hi Ashish,

Cheers for your continued support mate, much appreciated!

Feedback:

• Regarding the new “Shearer Cutting (New Logic)” formula, there really is only “3 Conditions” we will need to ever consider, namely:

1. Shearer is Cutting

2. Shearer is Flitting

3. Shearer is Not Cutting

• I have changed the last part of the calc “ “ results to match the three conditions,

Shearer Cutting (New Logic) formula:

if (([Shearer Speed] >=4.4 and ([LH Cutter Amps] >=50) or [RH Cutter Amps] >=50)) = TRUE then "Shearer is Cutting"

ELSEIF ([Shearer Speed] >=4.4 and ([LH Cutter Amps] <=50 or [RH Cutter Amps] <=50)) = TRUE then "Shearer is Flitting"

ELSE "Shearer is Not Cutting"

END

• I then attempted to create a new “Shearer Cutting Direction (New Logic)” formula but there appears to be a conflict?
• Regarding the new Shearer Cutting Direction (New Logic)” formula there is now “4 Conditions” we will need to consider, namely:

1. Shearer Cutting to MG

2. Shearer Cutting to TG

3. Shearer Stopped

4. Shearer is Flitting

• I have no idea how to introduce the “Shearer is Flitting” measure into the formula below, and as mentioned there is a conflict present,

Shearer Cutting Direction (New Logic) formula:

IF [Shearer Direction]="L" and [Shearer Cutting (New Logic)]=TRUE THEN 'Shearer Cutting to MG'

ELSEIF [Shearer Direction]="R" and [Shearer Cutting (New Logic)]=TRUE  THEN 'Shearer Cutting to TG'

ELSEIF ([Shearer Direction]="L" or [Shearer Direction]="R") and [Shearer Cutting (New Logic)]=FALSE  THEN 'Shearer Stopped'

END

………. “Shearer is Flitting”……..?

I have attached my Workbook, latest now_v3

Cheers,

Lance

• ###### 6. Re: Assistance required with a “Conditional Calculated Field”

Hi Lance,

Thanks for providing the necessary details. Please find the below calculation for "Shearer Cutting Direction (New Logic)"

IF [Shearer Direction]="L" and [Shearer Cutting (New Logic)]="Shearer is Cutting" THEN "Shearer Cutting to MG"

ELSEIF [Shearer Direction]="R" and [Shearer Cutting (New Logic)]="Shearer is Cutting"  THEN "Shearer Cutting to TG"

ELSEIF ([Shearer Direction]="L" or [Shearer Direction]="R") and [Shearer Cutting (New Logic)]="Shearer is Not Cutting"  THEN "Shearer Stopped"

ELSE "Shearer is Flitting"

END

Also attaching the .twbx file along with it for your reference. Let me know if that helps.

Also find the screenshot and confirm the output.

Thanks and Regards,

-Ashish Chaudhari

1 of 1 people found this helpful
• ###### 7. Re: Assistance required with a “Conditional Calculated Field”

Hi Ashish,

You nailed it mate! My dashboard is functioning beautifully!

I have also been able to broaden my understanding of calculated fields Thanx to you!

PS!

Can I ask that you follow me in the forum so I can bounce ideas off you on occasion?

Cheers,

Lance

• ###### 8. Re: Assistance required with a “Conditional Calculated Field”

Hi Lance,

I have followed you back.

Good efforts at your end as well, since you gave me appropriate information required by highlighting and making changes to the fields every-time. This has helped me to work mechanically due to which this question solved quickly, else it would have taken **** lot of time since I am not aware of this domain. Keep doing that for upcoming posts, you will get instant results for it. Best part was you knew your data well.