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
Try this may be:
LOAD MESSAGE_CODE
MESSAGE_DESC,
if(Len(Trim(MESSAGE_CODE))>0, MESSAGE_DESC,MESSAGE_CODE)) as Details
FROM $(path)MESSAGE_CODES.qvd;
Try this may be:
LOAD MESSAGE_CODE
MESSAGE_DESC,
if(Len(Trim(MESSAGE_CODE))>0, MESSAGE_DESC,MESSAGE_CODE)) as Details
FROM $(path)MESSAGE_CODES.qvd;
Having given a recommendation, it just doesn't make sense that when MESSAGE_CODE is not available then you want to use it for details? Are you sure you don't want this?
LOAD MESSAGE_CODE
MESSAGE_DESC,
if(Len(Trim(MESSAGE_CODE))>0, MESSAGE_CODE,MESSAGE_DESC)) as Details
FROM $(path)MESSAGE_CODES.qvd;
Hi,
As suggested by Sunny, you can try using Trim functions as your Condition.
Also, worth checking how are your values in 'MESSAGE_CODE' coming in QV and if you are getting '0' ?
It could sometimes be an issue with the Flag/ Binary numbers,
Try using Exists () function in your Condition.
Hope it helps !
Cheers !
Thanks for your reply,
Nope, when ever the MESSAGE_CODE is exiting in same field then populate the MESSAGE_DESC values else populate MESSAGE_CODE and we should not use any hard-code values to this fields.
Thanks & Regards,
Ram
it's not working my requirement could please change the IF condition.
May be this:
LOAD MESSAGE_CODE
MESSAGE_DESC,
if(Len(Trim(MESSAGE_DESC))>0, MESSAGE_DESC,MESSAGE_CODE)) as Details
FROM $(path)MESSAGE_CODES.qvd;
According to me, there is no sense in the expression you are using because you check against null on the MESSAGE_CODE and again give the null value if condition is false. Try to use below cond:
IF(LEN(TRIM(MESSAGE_DESC)),MESSAGE_DESC,MESSAGE_CODE)
Hi,
This should definitely work, check again
TableName:
LOAD MESSAGE_CODE
MESSAGE_DESC,
If(Len(Trim(MESSAGE_DESC))>0, MESSAGE_DESC,MESSAGE_CODE)) as Details
FROM $(path)MESSAGE_CODES.qvd;
Regards,
Jagan.
Hi Ram,
Try below code:
if(Len(Trim(MESSAGE_CODE))>0, MESSAGE_DESC,MESSAGE_CODE)) as Details
Regards
Neetha