6 Replies Latest reply on Mar 2, 2017 6:44 AM by Yuriy Fal

# 'Can't be applied to a user defined aggregate' error query on calculation

Hi all,

I have the following calculation i am trying to get into my worksheet.

SUM([Mobile Entry])-[Existing Players Entries ]

Mobile Entry is a boolean field (1,0).

Existing Player Entries is the result of the below calc, where both [is_new_player] and [Mobile Entry] are also boolean fields (1,0)

SUM(IF [is_new_player] = 0 THEN [Mobile Entry] ELSE 0 END)

When I drag my first calculation, SUM([Mobile Entry])-[Existing Players Entries ], into my worksheet i get the error in the title.

How can I get this calc into my worksheet without this error?

Thanks in advance for any help and unfortunately I cannot publish any workbooks or data for this due to this being sensitive client data so apologies for that!

• ###### 1. Re: 'Can't be defined to a user defined aggregate' error query on calculation

HI Bruce,

You may want to use

INT([Mobile Entry])

in both calculations.

Yours,

Yuri

• ###### 2. Re: 'Can't be defined to a user defined aggregate' error query on calculation

HI Bruce ,

Use type conversion function like Int() in both places .

Thanks

Sreenivasa

• ###### 3. Re: 'Can't be applied to a user defined aggregate' error query on calculation

Thanks Yuriy.

I'm a little new to Tableau so could you give me a bit more info?!

Should the calc read as follows now?

INT(SUM([Mobile Entry])-[Existing Players Entries ])

• ###### 4. Re: 'Can't be applied to a user defined aggregate' error query on calculation

Hi Bruce,

both [is_new_player] and [Mobile Entry] one?

Do you see T/F Icon to the left of each field?

If yes, the calculations would be like this:

SUM( INT( [Mobile Entry] ) ) - [Existing Players Entries ] )

// Your Second Calc named [Existing Players Entries ]

SUM(IF [is_new_player] = FALSE THEN INT( [Mobile Entry] ) ELSE 0 END)

Hope this helps.

Yours,

Yuri

1 of 1 people found this helpful
• ###### 5. Re: 'Can't be applied to a user defined aggregate' error query on calculation

Thanks Yuri, this worked

• ###### 6. Re: 'Can't be applied to a user defined aggregate' error query on calculation

Bruce, you're welcome.

Yours