Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dynamically calculate points for a metric based on formula stored in metadata.

rparimi
6 - Meteoroid

I have a requirement where

 

a) Metrics are stored in excel as metadata with a formula. User can add new metrics with formulas.

MetricFormula
Critical infrastructure designationIF [Raw Score] = 'No'
THEN 0
ELSE 5
ENDIF
% of high risk sites segmented and monitoredIF [Raw Score]='100%'
THEN 0
ELSEIF [Raw Score] >='85%' && [Raw Score]<='99%'
THEN '1'
ELSEIF [Raw Score]>='71%' && [Raw Score]<='84%'
THEN 3
ELSEIF [Raw Score]<='70%'
THEN 5
ELSE 0
ENDIF
# of non-segmented sitesIF [Raw Score]=0
THEN 0
ELSEIF [Raw Score] >=1 && [Raw Score]<=5
THEN '1'
ELSEIF [Raw Score]>=6 && [Raw Score]<= 10
THEN 3
ELSE 5
ENDIF

 

b) Also there is sheet where User has raw_score for Input Metric data. For ex: 

ID                 Metric                                        Raw_Score

1Critical infrastructure designationYes
2# of non-segmented sites4
3Critical infrastructure designationNo
4Critical infrastructure designationNo
5% of high risk sites segmented and monitored80
6# of non-segmented sites21
7% of high risk sites segmented and monitored40

 

3) I am expecting the Alteryx workflow to dynamically calculate the points based on raw_score by applying the formula for the metric which is defined in '1'

 

ID                    Metric                                          Raw_Score    Points

1Critical infrastructure designationYes5
2# of non-segmented sites41
3Critical infrastructure designationNo0
4Critical infrastructure designationNo0
5% of high risk sites segmented and monitored803
6# of non-segmented sites215
7% of high risk sites segmented and monitored405

 

Can you please recommend what tool can accomplish this type of output?

 

Thank you,

--Ramesh

8 REPLIES 8
apathetichell
20 - Arcturus

go to help - one tool workflow examples - dynamic replace.

rparimi
6 - Meteoroid

Thanks for the suggestion. I've tried that. Dynamic Replace is not helping because there is "n" rows of of formulas, it will add n columns as output. In my case, I just need one column for output that matches the formula associated with metric. Do you have an sample you can share as I'm running out of Ideas. 

rparimi
6 - Meteoroid

This is how far I came with the sample data.

OllieClarke
15 - Aurora
15 - Aurora

Hey @rparimi 

 

Dynamic replace is still the way to go, you just need to do a bit of transforming to get the output you want 🙂

OllieClarke_0-1631010615469.png

Hope that helps,

 

Ollie

 

atcodedog05
22 - Nova
22 - Nova

Hi @rparimi 

 

Interesting use case. Coincidentally I am also working on a similar project. My workflow is an extension of @OllieClarke (Thank you @OllieClarke from your workflow I was able to get few ideas to refine steps)

 

Workflow:

atcodedog05_0-1631012440309.png

 

If my solution helps please mark @OllieClarke 's post also as a solution since mine is just an extension of his 😅

 

Hope this helps : )

OllieClarke
15 - Aurora
15 - Aurora

Ah @atcodedog05, a complete solution! Nice 🙂

rparimi
6 - Meteoroid

Thanks @OllieClarke @atcodedog05 @apathetichell for the solution and help on my problem statement. This is exactly what I need and  solution will work for me. I will need to make additional changes, have additional columns/formulas to work with. 

 

I will keep you posted if I am stuck further in my solution but thanks very much for all the help. 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @rparimi 

Cheers and have a nice day!

Labels
Top Solution Authors