Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Add formula to a row only based on the value

hegdepavithra10
9 - Comet

I am trying to apply formula on two columns and create another column that would hold the result.

 

hegdepavithra10_0-1604670148356.png

i used formula to achieve this. However, the formula applies it to all the rows. My formula was IF [Employee Name] = "Pavithra" and [Percentage] >0.1 then "More than 10%" else "Not achieved the threshold" endif

 

Please help

21 REPLIES 21
atcodedog05
22 - Nova
22 - Nova

Hi @hegdepavithra10 

 

We can use a table tool to color it. Color is determined in the multi-row formula tool

 

Output:

atcodedog05_0-1604683491492.png

Output:

atcodedog05_1-1604683584504.png

Workflow:

atcodedog05_2-1604683601393.png

Render tool is required to output to excel with formatting

 

Hope this helps🙂

hegdepavithra10
9 - Comet

brilliant!!!! Thank you for all your assistance @atcodedog05 

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @hegdepavithra10 

 

Cheers and Happy Analyzing 😀

hegdepavithra10
9 - Comet

Hi @atcodedog05 

 

Is there a way , if percentage field is of the type "V_String" to  be compared with numbers.

 

for eg: Lets say percentage is of type "V_String" can the following operation be done

 

IF  [Employee Name] = "Pavithra" and [Percentage] >0.1 THEN "More than 10%" 
ELSEIF  [Employee Name] = "Kishore" and [Percentage] >0.6 THEN "More than 60%" 
// add more elseif for conditions
ELSE  "Not achieved the threshold" ENDIF

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @hegdepavithra10 

 

You can use ToNumber() function like ToNumber([Percentage]) to convert string to number.

 

IF  [Employee Name] = "Pavithra" and ToNumber([Percentage]) >0.1 THEN "More than 10%" 
ELSEIF  [Employee Name] = "Kishore" and ToNumber([Percentage]) >0.6 THEN "More than 60%" 
// add more elseif for conditions
ELSE  "Not achieved the threshold" ENDIF

 

Hope this helps 🙂 

Emil_Kos
17 - Castor
17 - Castor

Hi @hegdepavithra10 

 

IF [Employee Name] = "Pavithra" and ToNumber([Percentage]) >0.1 THEN "More than 10%"
ELSEIF [Employee Name] = "Kishore" and ToNumber([Percentage]) >0.6 THEN "More than 60%"
// add more elseif for conditions
ELSE "Not achieved the threshold" ENDIF

 

@atcodedog05 this time you are slightly faster then me 🙂 

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @hegdepavithra10 

 

Cheers and Happy Analyzing 😀

Emil_Kos
17 - Castor
17 - Castor

Hi @hegdepavithra10,

 

thank you for marking my post as a solution!

 

good luck!

hegdepavithra10
9 - Comet

Hi @atcodedog05 

 

When the render tool is used to output the table, I see in my excel extract most of the headings, values within them are cut off. I tried change the margins etc., but that didnt help.

 

Could you suggest?

atcodedog05
22 - Nova
22 - Nova

Hi @hegdepavithra10 

 

Even i faced that issue. I dont know the cause or how to fix it.

 

Sorry 😶

 

Maybe you can post it as a new question and people will help you.

Labels