Tips to create Advanced Formulas

Getting that exact value from your data which will unlock real business values can sometimes involve complex calculations and seem like something which can only be done by a data science graduate.

Phrazor brings those complex calculations all packaged in an easy to use way at your fingertips.

You can find as well as share tips and tricks to calculate any value from your dataset, be it from any domain or industry.

1 Like

If anyone wants to sort their Pivots on the basis of their categorical(alphabetical) values or as known widely in the programming world as β€œKeys”, here is a way to do that in Phrazor.

Let’s say you have a pivot:
a_pivot = {β€œB”: 43, β€œD”: 32, β€œA”: 12, β€œC”: 4}

Notice how the pivot is sorted on the basis of the values.

To sort this pivot on the basis of the keys you can use the following formula:
CreatePivot(Sort(Keys(a_pivot)), ValueFromKey(a_pivot, Sort(Keys(a_pivot))))

What this does is it basically sorts the keys first and then access the values one by one using this sorted keys list.

Your output will look like:
a_pivot = {β€œA”: 12, β€œB”: 43, β€œC”: 4, β€œD”: 32}

In case you want to apply any operation 3 of your pivots, you will have to use 2 separate operations.

For e.g.:

Lets say you need to multiply 3 of your pivots A, B and C.

To implement this you will have to do the following:
Product(Product(A, B), C)

Most of the functions in Phrazor work only on 2 input parameters, but you can apply another function on the resultant output of the first function and the 3rd parameter.