Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
Is there any Alternative for Above() Function in backend Script.
I don't wan't to use Order By desc in Script.
because I need Previous() and Above() at the same time.
I have achieved Result with Previous but for Above() I haven't received the Result.
See this:
See the Attachment.
Regards
Eric
Your desired output needs Below() not Above().
PFA
Cheers,
Hi Eric,
You should use below() function to achieve your result, PFA
You can use Peek() apart from Above().
Try this script -
t1:
Load * inline [
Number, Name, Code_1
1,India,NOT SAME
2,India,SAME
3,Uk,NOT SAME
4,Uk,SAME
5,Uk,SAME
6,USA,NOT SAME
7,Russia,NOT SAME
8,France,NOT SAME ];
t2:
Load *,
alt(Peek('Code_1',Recno(),'t1'),Code_1) as Code_2
Resident t1;
drop table t1;
Can be done without Aggr() function as well:
If(Below(TOTAL Name) = Name, 'Same', 'No Same')
Hi,
Try Peek().
Regards,
Jagan.
Yet another method could be using a similar to As-of Table concept:
Table:
LOAD *,
IF(Previous(Name)=Name,'SAME','NOT SAME') AS Code_1 INLINE [
NUMBER, Name
1, INDIA
2, INDIA
3, UK
4, UK
5, UK
6, USA
7, RUSSIA
8, FRANCE
];
Link:
LOAD NUMBER as LINK_NUM,
NUMBER,
'C' as Flag
Resident Table;
Concatenate (Link)
LOAD NUMBER as LINK_NUM,
NUMBER + 1 as NUMBER,
'L' as Flag
Resident Table;
Data Model:
Straight table
Dimension: LINK_NUM
Expression:
1) =Only({<Flag = {'C'}>} Name)
2) =If(Only({<Flag = {'C'}>} Name) = Only({<Flag = {'L'}>} Name), 'SAME', 'NOT SAME')
Hi All
I appreciate each and everyone's effort but i want the logic in Back end at Script level not at front end chart level.
Also, I need the Code_1 and Code_2 in one Load. I don't have to use concatenate.