Hello,
I have a field called "Initial/Follow-up" which associate with "Case ID" etc. The records in this field are number. "0" means "Initial", "1...to other number" means "Follow-up times", like this,
Initial/Follow-up
0
1
0
2
5
0
I would like to show "Initial" and "Follow-up num" as the record values, such as
Initial/Follow-up
Initial
FU#1
Initial
FU#2
FU#5
Initial
I created expression for the "Initial/Follow-up" field, if([Initial/Follow-up]=0,'Initial','FU#' & [Initial/Follow-up]) . But this doesn't work for Follow-ups, shows as below,
What can I do to get the FU number?
Thanks,
Becky
Seems to be working for the sample here:
Table:
LOAD *,
if([Initial/Follow-up]=0,'Initial','FU#' & [Initial/Follow-up]) AS NewField;
LOAD * Inline [
Initial/Follow-up
0
1
0
2
5
0
];
Seems to be working for the sample here:
Table:
LOAD *,
if([Initial/Follow-up]=0,'Initial','FU#' & [Initial/Follow-up]) AS NewField;
LOAD * Inline [
Initial/Follow-up
0
1
0
2
5
0
];
Thanks for the idea Sunny.
But the thing is the number I listed above is only for example. In the table there are thousands of numbers. Let's say the range of those numbers right now is from 0 to 10 follow-ups. In the future the num. of follow-ups could increase, such as from 0 to 12 follow-ups. Is there a better way to handle this?
Regardless of how many number of "Initial/Follow-up" you might have, you if statement should work.
Well, the inline load didn't work and won't work. As I don't know the order of the number. Or maybe I didn't really undertand that way you suggested.
But the good news is, I got it work by adding " if([Initial/Follow-up]=0,'Initial','FU#' & [Initial/Follow-up]) as [Initial/Follow-up] " in the Load data statement..
Thank you ,
Becky
Adding what? Single quote? I thought it was always there... No?
Sunny, I guess the problem was the use of the statement as expression in a table chart where the field values were not unambiguous within the dimensional scope.
Maybe like
=if(Max([Initial/Follow-up])=0,'Initial','FU#' & Max([Initial/Follow-up]))
I meant I didn't use the Inline load becuase it didn't work. I only add this line into load script: " if([Initial/Follow-up]=0,'Initial','FU#' & [Initial/Follow-up]) as [Initial/Follow-up] ".
It works just by doing this.
Super.... If you got what you wanted, please close this thread down by marking correct and helpful responses.
https://community.qlik.com/docs/DOC-14806
Best,
Sunny
Your first response was partial correct, as the inline load wasn't working. So I made it as helpful. I am happy to know if you have different opinion based on the action I make. Thanks again.