
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alternative of Above() Function in Backend Script.
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
- « Previous Replies
-
- 1
- 2
- Next Replies »


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your desired output needs Below() not Above().
PFA
Cheers,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Eric,
You should use below() function to achieve your result, PFA


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use Peek() apart from Above().

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can be done without Aggr() function as well:
If(Below(TOTAL Name) = Name, 'Same', 'No Same')

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try Peek().
Regards,
Jagan.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- « Previous Replies
-
- 1
- 2
- Next Replies »