Forum Discussion
Anonymous
4 years agoNot applicable
sum columm with condition
Hi guys,
I have trouble do to a task here
I do this
What i need
when [CodUser] be:
280 ||
621 ||
928 ||
512 ||
284
I want return the columm [jornadaMin] + 23, if another number i want return [JornadaMin] only
I want return the columm [jornadaMin] + 23, if another number i want return [JornadaMin] only
I do this, but don´t work
Look the return i have sum + 23 in every line
Thank you
Hi, Anonymous
You can try the following methods.
JornadaMin2 = IF ( [CodUser] IN ( { 280, 621, 928, 512, 284 } ), [JornadaMin] + 23, IF ( [CodUser] IN ( { 1772, 1226, 295, 975 } ), [JornadaMin] + 48, [JornadaMin] ) )JornadaMin3 = VAR n2 = [JornadaMin] + 23 VAR adm = [JornadaMin] + 48 VAR n = [JornadaMin] RETURN IF ( [CodUser] IN ( { 280, 621, 928, 512, 284 } ), n2, IF ( [CodUser] IN ( { 1772, 1226, 295, 975 } ), adm, n ) )Both formulas can get the results you want.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- parry2kSuper User
Anonymous what are these measures/columns? You have to be more specific?
- v-zhangtiCommunity Support
Hi, Anonymous
You can try the following methods.
JornadaMin2 = IF ( [CodUser] IN ( { 280, 621, 928, 512, 284 } ), [JornadaMin] + 23, IF ( [CodUser] IN ( { 1772, 1226, 295, 975 } ), [JornadaMin] + 48, [JornadaMin] ) )JornadaMin3 = VAR n2 = [JornadaMin] + 23 VAR adm = [JornadaMin] + 48 VAR n = [JornadaMin] RETURN IF ( [CodUser] IN ( { 280, 621, 928, 512, 284 } ), n2, IF ( [CodUser] IN ( { 1772, 1226, 295, 975 } ), adm, n ) )Both formulas can get the results you want.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.