Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Need Help with Multiple Row Formula

knamc_com
7 - Meteor

I am using a multi-row transformation, but I cannot seem to get the IF statement correct, hoping someone can help me out.

 

Here is the incoming data:

 

Count         Total          
3              3372.08    
3                245.73     
3              3617.81     

 

 

This is current output:

 

CountTotalLabel
33372.08TOTAL INVOICED PREMIUM
3245.73TOTAL INVOICED PREMIUM
33617.81TOTAL INVOICED PREMIUM

 

 

Need it to be:

 

CountTotalLabel
33372.08TOTAL INVOICED PREMIUM
3245.73INVOICED NO DEDUCTIONS
33617.81TOTAL INVOICE

 

 

Here is my logic in the Multiple Row tool:

 

IF [Row-1:Count] = 3 then "TOTAL INVOICED PREMIUM"
ELSEIF [Row-1:Count] + 1 = 3 then "INVOICED NO DEDUCTIONS"
ELSEIF [Row-1:Count] + 2 = 3 then "TOTAL UNUM INVOICE"
else 0
ENDIF

 

 

Any help is greatly appreciated :-)

 

5 REPLIES 5
rzdodson
12 - Quasar
beatriz_alteryx06
8 - Asteroid

Hello @knamc_com 

 

Your IF formula must be changed from colum "Count" to "Label", because all the rowls have 3 as value.

 

Pay attention if "Total" is numeric or string.

 

Since  you just have those options, type in the normal Formula tool:

 

IIF([Total] = 3372.08, "TOTAL INVOICED PREMIUM",

IIF([Total] = 3617.81 , TOTAL INVOICE,

IIF([Total] = 245.73 , "INVOICED NO DEDUCTIONS",

"")))

 

Raj
16 - Nebula

@knamc_com 
use this
if [Row-2:Count] = 3 and [Row-2:Count] = 3 then "TOTAL INVOICE" elseif [Row-1:Count] = 3 and [Count] = 3 then "INVOICED NO DEDUCTIONS" else "TOTAL INVOICED PREMIUM" endif

hope this helps.

Qiu
21 - Polaris
21 - Polaris

@knamc_com 
It looks like that the label is based on the Row number?

If yes, then we can use a Tile tool to do as below

0501-knamc_com.png

knamc_com
7 - Meteor

Total will always be different but # of rows will be the same, thank you

Labels
Top Solution Authors