Support the ongoing development of Laravel.io →
posted 8 years ago
Database
Last updated 1 year ago.
0

// converted to php if statement, to better understand it in a php way

    $cellValue = '';

    // if(A2=""
    if ($a2 = "") {
        // ;""
        $cellValue = "";
    } else {
        // ;if(OR(R2="Email";L2="Service Catalog")
        if ($r2 = "Email" || $l2 = "Service Catalog") {
            // ;0
            $cellValue = 0;
        } else {
            // ;IF(AND(I2=VRAI;J2="Yes")
            if ($i2 = $vrai && $j2 = "Yes") {
                //;1
                $cellValue = 1;
            } else {
                // ;0)))
                $cellValue = 0;
            }
        }
    }

So the breakdown is for where the cellvalue would equal 1,

if A2 is not empty, and R2 is not 'Email' or L2 is not "Service Catalog', and I2 = 1 and J2 = "Yes"

This should result in the cellvalue = 1

What table/columns match the A2, R2, L2, VRAI, J2

If i have the tables/colums right,

A2 = table 'ticket_dim', column 'Number'
R2 = table 'fact', column 'Contact_type'
L2 = table 'fact', column 'Category'
J2 = table 'tickets_dim', column 'fcr_resolvable'
I2 = table 'tickets_dim', column 'fcr_resolved' 
VRAI = 1

Maybe changing these,

$FCR_SPL=DB::table('fact')
                ->join('tickets_dim', 'fact.fk_ticket', '=', 'tickets_dim.Id')
                ->join('contact_dim', 'fact.fk_contact', '=', 'contact_dim.Id')
                ->whereNotNull('tickets_dim.Number')  // A2 not empty
                ->where('Contact_type','not like','%Email%') // R2 not equal 'Email'
                ->orwhere('Category','not like','%Service Catalog%') // L2 not equal 'Service Catalog'
                ->where('tickets_dim.fcr_resolvable','=','Yes') // J2 equal 'Yes'
                ->where('tickets_dim.fcr_resolved','=','1') // I2 equal 1
                ->count();
Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

javaoui javaoui Joined 9 Feb 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.