Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Income,expensive,expensive 01,Income 01
1000,100,100,0
800,200,200,600
1500,300,200,500
but he want to see Income - expensive - expensive 01 + Income 01 as Income_total by using Peek() function only.
Please anyone help me
Hi,
Try like this
Data:
LOAD
*,
Previous([Income]) - Previous([expensive]) - Previous([expensive 01]) + Previous([Income 01]) as Income_total
INLINE [
Income,expensive,expensive 01,Income 01
1000,100,100,0
800,200,200,600
1500,300,200,500];
You can use Previous() for this. If you are not looking for this let me know your expected output.
Regards,
Jagan.
What is the output you are expecting from the above input?
Hi ,
If you only want the total and strictly want peek function.. then try this:
set errormode =0;
Table:
LOAD * Inline
[
Income,expensive,expensive01,Income01
1000,100,100,0
800,200,200,600
1500,300,200,500
];
for i=0 to NoOfRows('Table')-1
test:
load Distinct
peek('Income',$(i),'Table')-peek('expensive',$(i),'Table')-peek('expensive01',$(i),'Table')+peek('Income01',$(i),'Table') as Total
Resident Table;
NEXT
ENDIF
Try this
u can use Previous or peek function instead of complex scenarios
sunilkumarqv Mar 12, 2014 2:05 AM (in response to muralivijay)
Try this