Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Rule Executor question please help!

  1. #1
    Join Date
    Jun 2015
    Posts
    4

    Default Rule Executor question please help!

    Hi all,

    do you know a way how i can execute a step based on a resultset output from previous step values of 3 columns?

    Probably i need to use Rule Executor but tbh i hope someone knows an alternative better way..

    I give you an example:

    1. Transaction 2. Trigger 3. Instant
    Lead Click 1
    Lead Impression 0
    Lead Click 5

    Results based on 2 fields are as follows:

    if Transaction : Lead & Trigger : Impression = Lead_Impression

    if Transaction : Lead & Trigger : Click = Lead_Click

    Results based on 3 fields are as follows:

    if Transaction : Lead & Trigger : Impression & Instant > 0 = Lead_Impression_instant

    if Transaction : Lead & Trigger : Click & Instant > 0 = Lead_Click_instant

    Probably i need to use "Modiefied JavaScript Value"??

    Any suggestios or tips how i ca solve that?

    Many thanks in advance.

    Cheers, Circ

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    Or you can split your stream using Filter rows (or Switch Case) and direct different rows to different steps/transformations.
    -- Mick --

  3. #3
    Join Date
    Jun 2015
    Posts
    4

    Question

    Thanks so far for your reply.. Filter row seems to be viable option, but i dont know how to generate the results in the output step..
    I need to find a way to execute a step based on a resultset output from values of 4 columns?

    Transaction Type, Trigger Type, Instant Transaction, Basket Value (See Example_input.xls)
    The conditions i need to check before i can pass the value to the concrete column in the output (Example_output.xls) are as follows:
    Results based on 2 fields are as follows:
    if Transaction Type is Lead & Trigger is Impression = Lead_Impression
    if Transaction Type is Lead & Trigger is Click = Lead_Click
    Results based on 3 fields are as follows:
    if Transaction Type is Lead & Trigger Type is Impression & Instant > 0 = Lead_Impression_instant
    if Transaction : Lead & Trigger : Click & Instant > 0 = Lead_Click_instant
    Additionally i have to check the Basket Value if it has a value its the sale variant of above conditions..
    At the end of my transformation my output should look like in the attached file (Example_output.xls)

    Example_input.xls


    Example_output.xls
    Last edited by Circassasin; 06-25-2015 at 03:27 AM.

  4. #4
    Join Date
    Jun 2015
    Posts
    4

    Default Solved

    Ok Modified Javascript Value.. works perfect.

    //Script here


    var sales_pc = 0;
    var sales_pc_instant = 0;
    var sales_pv = 0;
    var sales_pv_instant = 0;
    var leads_pc = 0;
    var leads_pc_instant = 0;
    var leads_pv = 0;
    var leads_pv_instant = 0;

    if(TriggerType == "Click" && InstantTransaction > 0 && BasketValue > 0) {
    sales_pc_instant = 1;
    } else if(TriggerType == "Click" && InstantTransaction == 0 && BasketValue > 0) {
    sales_pc = 1;
    } else if(TriggerType == "Ad Impression" && InstantTransaction > 0 && BasketValue > 0) {
    sales_pv_instant = 1;
    } else if(TriggerType == "Ad Impression" && InstantTransaction == 0 && BasketValue > 0) {
    sales_pv = 1;
    } else if(TriggerType == "Click" && InstantTransaction > 0 && BasketValue == 0) {
    leads_pc_instant = 1;
    } else if(TriggerType == "Click" && InstantTransaction == 0 && BasketValue == 0) {
    leads_pc = 1;
    } else if(TriggerType == "Ad Impression" && InstantTransaction > 0 && BasketValue == 0) {
    leads_pv_instant = 1;
    } else if(TriggerType == "Ad Impression" && InstantTransaction == 0 && BasketValue == 0) {
    leads_pv = 1;
    }



    Modiefied_conditional_conversion_JS.ktr

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.