Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I tried
If (ColumnA='X',Avg(ColumnB),0)
But doesn't give me any data...
can you upload an litle example?
Try this:
avg(If (ColumnA='X',ColumnB))
Cheers!
i believe the reason you are not getting any results is because the syntax says if Column A = X then I want the average of column B, which at this point does not contain anything.
You want to create the values in column B to be the average of column A, only if column A = X
you need something along the line of avg(if(column A='X', column B)) or yopu could also set column b = to a before you implement your original code - then your original code would work
if(column A='X', column B)
If (ColumnA='X',Avg(ColumnB),0
Thanks a lot!!
my recommendation would be to use Varun's solution - it is a little cleaner than the one I suggested
I am glad that my suggestion helped you
Cheers!
Check Attached.
Or this with Set Analysis:
Avg({<ColumnA = {'X'}>} ColumnB)