Hello,
I have measured 2 fields I want to subtract in a new calculated field.
First field is a calculated field : min(Amount, [OperatingType, SessionId, Date])
The second field is just a number: Plantscount
How can I do it?
Thanks,
Mia
Hello,
I have measured 2 fields I want to subtract in a new calculated field.
First field is a calculated field : min(Amount, [OperatingType, SessionId, Date])
The second field is just a number: Plantscount
How can I do it?
Thanks,
Mia
Hi @miap - Can you explore minOver on the calculated field and then try to do a subtract from the first field, use pre_agg also. Please see the same kin of question from the below link -
Regards - Sanjeeb
Hi @Sanjeeb2022 ,
Thank u for the response,
I can’t convert this - min(Amount, [OperatingType, SessionId, Date])
into a new calculation that uses the ‘over’ function.
Do u have any suggestions?
Thanks
Hi @ErikG,
I receive an error when trying the subtract-
plantsCount - minover(sum(Amount), [OperatingType, SessionId, Date])
I want to create this calculation-
Plantscount - min(Amount, [OperatingType, SessionId, Date])
What error do you get?
Mismatched aggregation
Is plantsCount already a calculated field? Maybe you can try sum(plantsCount) or avg(plantsCount)
Hi @miap - Please share the sample input data and expected output.
Regards - Sanjeeb
Sample input:

The expected output is a calculation by farm:
min(Plants count)-sum(min(Amount, [OperatingType, SessionId,Date])
For example-
Dim: Farm ‘031-MVP’
Measure: 15840- (3230+3480) = 9130
Is it working now? With min(Plants count)-sum(min(Amount, [OperatingType, SessionId,Date])?
Or still Mismatched aggregation?