How do I extract the values and count

Hi Community,

I would like to extract the values from the a column and count how often the value has appeared. I tried Rule Engine Node and Column Expressions Node but it is not working the way I would like the result to be…

There are four different payment and I would like to count the numbers from the payments

At the end I want to create a Bar Chart which shows the payment type in different regions

Would be grateful for any suggestions, thanks!

BR

Hello @ppeng

have you tried to use a Group By node?

Have a nice day,
Raffaello

hi @lelloba,

yes! I grouped the “Order Regions” and Count the “Type”.
But it only shows the total number form each Region.

What I would like to figure out is how do I extract the values before I count them, so at the end it shows Region A hast used Type 1 for xxx times and Type 2 for xxx times and Type 3 for xxx times.

Best Regards

Hello @ppeng,

aah I got the problem. Add a constant value column with “1” as value, so in the later Group By node you have a column for counting.

Have a nice day,
Raffaello

Hi @lelloba,

thanks for the quick reply.
But I don’t get quit you mean, can you maybe explain it in another way what I should do with the constant value column Node.
Do I just add it before the GroupBy Node with an append-Column?

Best Regards

Sorry for not being clear.
Here is a small workflow.

You said you have two columns, and if you use both in your “Groups” section in the group by node you are left with no column to make the count number of rows.


So, if we add a new column with a fixed value, you can use the new column to count rows. So, take a constant value column node and create a column full of 1s, then use the newly created column to count rows in the group by node :slight_smile:

Raffaello

3 Likes

Hi @lelloba,

thank you so much for the explanation. It worked out! :pray:

A further problem with the Bar Chart. Since I can only choose on Column as Category Column in Bar Chart Node. So it always shows either the count from Region or from Type? Do you have any suggestions what I should do to make them all shown at once?

Much thanks again!

BR

No problem :slight_smile:

For the bar chart problem, concatenate the two categories use the new attribute to make the plot.
Have a look at the workflow attached, I have updated it adding the bar plot.

Raffaello

1 Like

I tried to create a new Expression with the two column “Type” and “Order Region” but I cant find the right function which this two Columns :sweat: Can you help me out with it please?

Thanks!
Best Regards

Hello @ppeng ,

you mean this expression?

Raffaello

1 Like

Hi @lelloba,

is this how the result should be?

Would it be possible to present it not fully listed, but like the bar chart I posed it in the last comment?

Best Regards

Hi @ppeng ,

yes, that’s what I was looking for. Maybe we could use a sorter, so you can get the most important categories first.

If you want something like in your chart, have a look at the updated workflow here.

Raffaello
Linkedin

2 Likes

Hi @lelloba,

thanks a lot for the helping and explaining! It worked out perfectly :slightly_smiling_face:

Have a nice day!
Best Regards

1 Like

You’re welcome :slight_smile:

you too!

Raffaello

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