We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Dynamic Row Addition Based on Specific Labels

giacomodellatti
5 - Atom

I'm facing an issue with my workflow, and I hope you can help me.

In my input file, I only have one row of data, like this:

 
SEE ATTACHED EXCEL FILE "input_dynamic_rows".
 

I need to dynamically add two additional rows to the output table, with the same "Type" and "Company Code," but with the "Sums" fields set to zero. The result should look like this:

 

SEE ATTACHED EXCEL FILE "output_dynamic_rows".

 

The challenge is that the solution must be dynamic. I won't always know which "Label" will be in the input file. For example, one day it could be "IC_export_services," while on another day, the input could have two labels: "IC_export_goods" and "IC_export_services."

However, the output table must always include these three specific labels:

  • "IC_export_services"
  • "IC_export_goods"
  • "Tax on goods & Services 10%"

Can anyone suggest a dynamic approach to achieve this?

3 REPLIES 3
OTrieger
14 - Magnetar

@giacomodellatti 
As you know what are the needed output label, just set one file with all of them and union it based on the given labels, in that way you always will have all labels.

To create the lines you can use the Generate Rows tool

Mathias_Nielsen
9 - Comet

Hi @giacomodellatti,

 

You can also try a filter tool with the following:

[Labels] = "IC_export_services" or
[Labels] = "IC_export_goods" or
[Labels] ="Tax on goods & Services 10%" and
[Sum of Tax base amount] != 0

 

It will at least yield the desired result.

CoG
14 - Magnetar

Here is another solution that utilizes the Join Tool to identify which labels are missing (the benefit here is that you can pass an input file with 1,2, or 3 of the labels, and the output will always have all 3)

 

Screenshot.png

 

Hope this helps and Happy Solving!

Labels
Top Solution Authors