Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Does anyone know what could cause the following?
This expression returns 0 UNLESS I apply rtrim() to the field in the script.
sum(if([Segment 1]='700400', [Credit Amount]+[Debit Amount]))
This function returns the correct value if the charts dimension is set to [Segment 1]
if([Segment 1]='700400', sum([Credit Amount]+[Debit Amount]))
This makes absolutely no sense to me. And Yes I have checked, without Rtrim applied the values in [Segment 1] contain no leading or trailing spaces, and I do have Verbatim set=1 And the field is formated at Text.
HI
Please check like this
Len() function and note that the length of segment1 by using rtrim and without rtrim function
Hope it helps to find the difference.
Both return result of 6. I also forgot to mention that the first expression will also return the correct value if I select the value 700400 in [Segment 1].
Also the following works for all situations, I just need to know the reason before I go and start changing things, as thing may be more widespread than I am aware.
sum({<[Segment 1]={'700400'}>}[Credit Amount]+[Debit Amount])
HI
Set Analysis gives better performance when compare to if statement. so you can go with set analysis. Like this
sum({<[Segment 1]={'700400'}>}[Credit Amount]+[Debit Amount]).
Always prefer set analysis, mostly try to avoid if statement.
Suppose, i misunderstand your question means, sorry for that
Hope it helps.
Yeah, I know it works, and that it is usualy better. I also usually go for set analysis, but this statment was before I new it well enough to be comfortable.
I am more concerned with the why due to other issues I may not think of, spread across 12 daswhboards with hundreds of possible expressions.