The calculation I want to do is for each month, calculate ColumnC(When ColumnB = ''H2")/ColumnC(When ColumnB = ''H1"). I need to create a calculated field. How can I do that?

Not quite sure I follow exactly what you want to do. Sounds like you want to a calculation based on whatâ€™s in column B. Is ColumnC a percent already or does the percent need to be calculated? Youâ€™ll likely want something like I have below but Iâ€™ll need a little more info before I can help finish the calculated field:

ifelse(

{ColumnB} = H1, [calculation]

)

Hi, column C is not percent. ColumnC is a value, I want to calculate: the value (ColumnC) of H2/ the value (ColumnC) of H1 for each month.

the results should be

I tried:

`ifelse({columnB}='H2', {columnC}/ifelse({columnB}='H1', {columnC}, NULL), NULL)`

it only gave me NULL values. The problem is H1 and H2 are in the same column but on different rows.

Hi @Bruton3, you might want to per-process this data in your source database to add a new column that will store the H2 values in the newly column but in the same row and then you create the % values accordingly.

Let us know if this solution approach works for you.

Thanks

Deepak

Here is the expression you can use for it

sum(ifelse(ColumnB=â€śH2â€ť, ColumnC, 0), [Month])/sum(ifelse(ColumnB=â€śH1â€ť, ColumnC, 0), [Month])