Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
My source like below..
Name | type | typeid |
aaa | nondeal | GRp |
bbb | cnf | 1X1 |
ccc | fv | 2X1 |
ddd | nondeal | GRP |
fff | cnf | 1X1 |
xxx | FD | 2X1 |
yyy | RD | GRP |
zzz | FD | GRP |
eee | RD | 1X1 |
from there we need want rank and count of type id.
but here that count only we need nondeal and cnf,fv this three only need count and remaning as usual display..
I am expacted o/p is ..
type | cnf | FD | FD | fv | nondeal | nondeal | RD | |||
Name | rank | no of typeid | typeid | 1X1 | 2X1 | GRP | GRP | GRp | ||
aaa | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | |
bbb | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |
ccc | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | |
ddd | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | |
eee | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
fff | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |
xxx | 2 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | |
yyy | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
zzz | 2 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
T:LOAD * INLINE [
Rank , count
1,100
2,95
3,80
4,60
-,-
-,-];
load if(Rank='-',0,Rank) as Rank,
if((count='-'),0,count) as Count
Resident T;
drop table T;
Script:
Set Nullinterpret = '-';
NullasValue Rank, count;
Set NullValue = '0';
Table:
LOAD *, RowNo() as ID Inline [
Rank , count
1,100
2,95
3,80
4,60
-,-
-,-
-,-
];
OR In Front end
Alt(count, 0)
Hi Shivesh,
My rank and count is calculated dimension in UI level. not in Script level.
Thanks
NAni
Hi
Use Alt function in UI