Batch Modes

Hello everyone,

Is there any handy tool that could replace cross join in the case below?

After building a workflow to calculate some measures, I would like to run this for all the element in a list (a seperate excel file). I think this works like looping right? I don’t wanna have too many rows to be appended to the dataset. In this example the List just consists of 3 Elements so that I use cross join but in case it is up to 100 that doesn’t seem very nice. In the Rule Engine Tool, It is desired to create a new column filling with the element in the file (Ausprägung). Looking forward to a dynamic solution.

Thanks for your guide!


Hello @Tram_Nguyen ,

could you rephrase what you need to do? I understand you need to calculate some combinations with two Cross Joiner nodes and then you give a label according to some condition inside the Rule Engine, but I think I’m missing what the workflow is doing and why. Without a good understanding, I am afraid I can’t give you a precise advice.

However, if you need to calculate all combinations with the csv and Excel files in input, the cross joiner might be your best alternative.

Let me know :slight_smile:

Have a nice day,
Raffaello

1 Like

Hello @lelloba,

Thanks! I attached below the screenshot of the output file. The Column in the middle resulted from the Rule-based Engine.


image

This is the excel file I’d have as input. The desired output would be a table having different combination of all the calculations like above for all elements in the excel input files (currently 3 items but later could be more). I’ve used cross joiner tool but the ouput table after cross joiner would be too big if there were 100 elements in the excel file. I’m looking for a dynamic solution that instead i just need to build a sample workflow for 1 element and run it iteratively for the other elements. Of course the end result table contains all the rows unioned (similarly achieved by using cross joiner…). So basically, it’s similar to batch macro concept in Alteryx, if it rings a bell.

Hope it helps clarify a bit.

Thanks for your attempt!
Tram

Ooh I see.

Then you could just add a group loop node that iterates on Auspraegung, then use only one of your cross joiners for your combination creation. Than write your Excel and end loop with a variable end loop node (this creates one Excel file for each iteration; if not required, we will create just one).

Another thing we could do is applying a nominal row filter, so that in case you could exclude some names, they would not be included in the loop.

I think it can work. Do you want me to build a small example?

RB

Yes, please. As a fresher here, I’ve no clue how to configure this group loop node.

No worries :slight_smile:
Tell me if it can work for you or if you need some edits.

Raffaello

3 Likes

Hi @Tram_Nguyen , on my side, I still don’t understand what you are trying to do :slight_smile:

Nevertheless, I just wanted to comment on your Rule Engine:
1- Is there any reason why you are using “LIKE” instead of “=” for the comparison? Are you using any wildcard in your comparison? There is a misunderstanding among some people where they think that “=” can only be used with numeric values, and not with string. Just wanted to clarify that it can be used to compare string values.
2- The 2 statements that you have are basically mutually exclusive, which means that you can write the statements as follows instead:

$combination$ = $new column$ => $Ausprägung$
TRUE => "Rest"

The TRUE statement represent the default value if none of the rules above it is satisfied. This will run much faster than what you have, as your NOT statement will have to be evaluated.

@lelloba you can probably simply link your String To Path (Variable) to your Column Expressions node instead of linking the Loop Start to the Column Expressions and String To Path (Variable) to Excel Writer.

2 Likes

Hey @lelloba , I’m not sure what is the purpose of using Variable Expression and String to Path… It’s a bit hard to imagine what’s going on without any input data.

Now you know how we feel :joy: :joy: :joy: :rofl: :rofl: :rofl:
Hint: We did not get any input data from you :wink:

3 Likes

Hi @bruno29a,

This is to address your concern :slightly_smiling_face:

  1. Yes, I’m using wildcard * in the String Manipulation tool. That’s why I used LIKE.
  2. I’m not sure if there is any better way of writing an If statement for “elseif”, or “else”… That why I come up with this:
    image
    Thanks for the shortcut. From now on I shall use TRUE statement when the statement is not met.

Cheers,
Tram

1 Like

This could help somehow as input:

image
image
image
image

Hi @Tram_Nguyen no problem.

Basically, the following if…elseif…else:

if ($combination$ LIKE "condition 1") {
  "Good"
} elseif ($combination$ == "condition 2") {
  "Better"
} elseif ($combination$ == "condition 3") {
  "Best"
} else {
  "OK"
}

would translate to this in Rule Engine:

$combination$ LIKE "condition 1" => "Good"
$combination$ = "condition 2" => "Better"
$combination$ = "condition 3" => "Best"
TRUE => "OK"

The way you had your statements, they would translate to:

if ($combination$ == $new column$) {
 $Ausprägung$
} elseif($combination$ != $new column$) {
  "Rest"
}

That elseif() is slower than else, because else has nothing to evaluate, but elseif() does

3 Likes

Very clear explanation. Thanks a great deal :slight_smile:
Btw, I’m a big fan of United for 20 years
Cheers

2 Likes

Hi @Tram_Nguyen
Bạn ứng dụng được gì chưa? Mình đang thử cho NH, nhưng có vẻ tốc độ xử lý chậm nhiều cpu

Trao đổi thêm qua tel ko bạn hunghhvn

Hi ban @thienhd, minh da giai quyet dc bai toan nay roi. Cam on ban quan tam!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.