Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Peek() fuction

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

Labels (1)
6 Replies
jagan
Partner - Champion III
Partner - Champion III

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.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Check this hope it helps you.

Peek() vs Previous() – When to Use Each


Regards,

jagan.

tresB
Champion III
Champion III

What is the output you are expecting from the above input?

sushil353
Master II
Master II

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

sunilkumarqv
Specialist II
Specialist II

Try this

sunilkumarqv
Specialist II
Specialist II

u can use Previous or peek function instead of complex scenarios

Re: Peek() fuction

sunil kumarExpert

Try this