Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
How can i combine the 2 expression together to achieve this outout:
V1 (7.6) Vs V2 (8.9)
=Subfield(GetFieldSelections([Vessel/Voy]),',',1)&' Vs '&''&sum({$<[Vessel/Voy]={'$(v1)'}>}PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v1)'}>}CNTR_N),''##,###.#'')
=Subfield(GetFieldSelections([Vessel/Voy]),',',1)&' Vs '&''&sum({$<[Vessel/Voy]={'$(v2)'}>}PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v2)'}>}CNTR_N),''##,###.#'')
You can use the concatenation operator & to concatenate two strings (and remove the second equal sign). Also check your quoting, I think the format code of the num() function should be embedded in single quotes only.
=Subfield(GetFieldSelections([Vessel/Voy]),',',1)&' Vs '&''&sum({$<[Vessel/Voy]={'$(v1)'}>}PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v1)'}>}CNTR_N),'##,###.#')
&
Subfield(GetFieldSelections([Vessel/Voy]),',',1)&' Vs '&''&sum({$<[Vessel/Voy]={'$(v2)'}>}PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v2)'}>}CNTR_N),'##,###.#')
edit:
Wait, where are the functions like num that used the format code at all. I've added num() functions.
=Subfield(GetFieldSelections([Vessel/Voy]),',',1)&' Vs '&''&Num(sum({$<[Vessel/Voy]={'$(v1)'}>}PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v1)'}>}CNTR_N),'##,###.#')
&
Subfield(GetFieldSelections([Vessel/Voy]),',',1)&' Vs '&''&Num(sum({$<[Vessel/Voy]={'$(v2)'}>}PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v2)'}>}CNTR_N),'##,###.#')
What does the value you are getting for this, And can you provide the values of [Vessel/Voy]
SubField(GetFieldSelections([Vessel/Voy]),',',1) -- If This is V1
=Subfield(GetFieldSelections([Vessel/Voy]),',',1)& ' ' & '(' & Num(sum({$<[Vessel/Voy]={$(=Subfield(GetFieldSelections([Vessel/Voy]),',',1))}>} PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]=>}CNTR_N),''##,###.#'') & ')' & ' ' & ' Vs ' &
Subfield(GetFieldSelections([Vessel/Voy]),',',1)& ' ' & '(' & Num(sum({$<[Vessel/Voy]=>} PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]=>}CNTR_N),''##,###.#'') & ')'
Note: I didn't understand the $(v1) & $(v2)
OR
=Subfield(GetFieldSelections([Vessel/Voy]),',',1)& ' ' & '(' & Num(sum({$<[Vessel/Voy]={'$(v1)'}>} PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v1)'}>}CNTR_N),''##,###.#'') & ')' & ' ' & ' Vs ' &
Subfield(GetFieldSelections([Vessel/Voy]),',',1)& ' ' & '(' & Num(sum({$<[Vessel/Voy]={'$(v2)'}>} PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v2)'}>}CNTR_N),''##,###.#'') & ')'
Note: I've added NUM Function here
Hi Anil
Pls see attached , doesnt work with the NUM function.
The problem with the num() function is the incorrect quoting of the format code. use single quotes only:
=Subfield(GetFieldSelections([Vessel/Voy]),',',1)& ' ' & '(' & Num(sum({$<[Vessel/Voy]={'$(v1)'}>} PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v1)'}>}CNTR_N),'##,###.#') & ')' & ' ' & ' Vs ' &
Subfield(GetFieldSelections([Vessel/Voy]),',',1)& ' ' & '(' & Num(sum({$<[Vessel/Voy]={'$(v2)'}>} PM_WAIT_TIME_Q) / Count ({$<[Vessel/Voy]={'$(v2)'}>}CNTR_N),'##,###.#') & ')'
Thanks but the missing num in v2 ()
try this:
Subfield(GetFieldSelections([Vessel/Voy]),',',1)& ' ' & '(' & Num(sum({$<[Vessel/Voy]={'$(v1)'}>} PM_WAIT_TIME_Q) /
Count ({$<[Vessel/Voy]={'$(v1)'}>}CNTR_N),'##,###.#') & ')' & ' ' & ' Vs ' &
Subfield(GetFieldSelections([Vessel/Voy]),',',2)& ' ' & '(' & Num(sum(aggr(sum(PM_WAIT_TIME_Q) /
Count (CNTR_N),[Vessel/Voy]))-sum(aggr(sum({$<[Vessel/Voy]={'$(v1)'}>}PM_WAIT_TIME_Q) /
Count ({$<[Vessel/Voy]={'$(v1)'}>}CNTR_N),[Vessel/Voy])),'##,###.#') & ')'
hope this helps!
superb 😃
Im glad that it works 🙂
Please close the thread by marking correct answer. It will help others (who browse for the similar problem) to find the solution.