Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
below is my issue highlighted in red.
LOAD MESSAGE_CODE
MESSAGE_DESC,
if(Len(MESSAGE_CODE)>0, MESSAGE_DESC,MESSAGE_CODE)) as Details
FROM $(path)MESSAGE_CODES.qvd;
if the MESSAGE_CODE is exists then display MESSAGE_DESC dimension values else display MESSAGE_CODE dimension values, but it is displaying always MESSAGE_CODE dimension values in the report.
Can any one suggest me.
Thanks in advance.
Regards,
Ram
I see two problems - one in the question, and one in the suggested answers...
1. The way your IF statement is formulated, you want to use the Code when the Code value doesn't exist - so, every time the code value is NULL, you want to see NULL in your field. It sounds "upside-down" to me. Usually we ask "if this value is NOT NULL, then use it, otherwise use another value".
2. In the suggested solutions, people keep suggesting to use TRIM(LEN(...)), which is meaningless. The function len returns the Length of the field, which is a number. The function TRIM is only useful when it's applied to the field itself, not to its length. So, if anything, the following can be considered:
LEN(TRIM(Field))
This combination of the two functions will first trim the spaces on both ends of the field, and then calculate the length of the remaining value. The meaning is to treat any number of spaces the same way as empty strings.
cheers,
Oleg Troyansky
QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense
Thank you all, it's working for me and issue with the data.
HI Ram,
Does sunny's solution solves your issue?
Thanks for your reply,
yes the Sunny's solution is working fine for me, if you have any other solution for this issue please share it.
Thanks &Regards
Ram