Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
how can i translate this sql query in a QV expression:
select sum(field_x)
from (select distinct ID, field_x from table_y)
Basically i want to calculate an expression as a sum of data from a field but only for other distinct values in an ID filed.
Thanks!
Probably I have not got you right, may be like this?
Straight table; dimension-ID, Expression: Sum(field_x). // if not this, would request to explain with an small example (table).
If you have several records per ID with the same field_x value then you can get the sum of the distinct values by using the max or avg function first: sum(aggr(max(field_x),ID))
Thanks G. for the solution!