Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

using function Qualify and Unqualify Statment

please give answer to use PEEK or any function within Qualify and Unqualify statement. below is eg script

QUALIFY *;

funcPEEKtbl:

LOAD Year,

     Sales,

     PEEK(Sales) As PeekfuncWrk

FROM

Book1.xlsx

(ooxml, embedded labels, table is Sheet1);

UNQUALIFY *;

result is NULL as done with below experiments

1. PEEK(Sales) As PeekfuncWrk

2. PEEK('Sales') As PeekfuncWrk

3. PEEK(funcPEEKtbl.Sales) As PeekfuncWrk

4. PEEK('funcPEEKtbl.Sales') As PeekfuncWrk

5. PEEK(funcPEEKtbl.Sales,-1,funcPEEKtbl) As PeekfuncWrk

6. PEEK('funcPEEKtbl.Sales',-1,'funcPEEKtbl') As PeekfuncWrk

but PEEK function works correctly without Qualify statment

13 Replies
marcus_sommer

This should work:

PEEK([funcPEEKtbl.Sales]) As PeekfuncWrk

     or

PREVIOUS(Sales) As PeekfuncWrk


- Marcus

Not applicable
Author

tried but not working. below is the original script

QUALIFY *;

funcPEEK2015Budgettbl:

LOAD Year,

     [2015 Budget]

FROM

[Practicing Data Files\Data for func Peek and Previous1.xlsx]

(ooxml, embedded labels, table is [2015Budget]);

funcPEEK2016Budgettbl:

LOAD Year,

     [2016 Budget],

     Peek([funcPEEK2016Budgettbl.2016 Budget]) As funcBudgetPEEK

FROM

[Practicing Data Files\Data for func Peek and Previous.xlsx]

(ooxml, embedded labels, table is [2016Budget]);

UNQUALIFY *;


executed script successfully but field funcBudgetPEEK returns ' - ' value


Peek([funcPEEK2015Budgettbl.2015 Budget]) As funcBudgetPEEK

sunny_talwar

Try this:

QUALIFY *;

funcPEEK2015Budgettbl:

LOAD Year,

    [2015 Budget]

FROM

[Practicing Data Files\Data for func Peek and Previous1.xlsx]

(ooxml, embedded labels, table is [2015Budget]);

funcPEEK2016Budgettbl:

LOAD Year,

    [2016 Budget],

    Peek('funcPEEK2016Budgettbl.2016 Budget') As funcBudgetPEEK

FROM

[Practicing Data Files\Data for func Peek and Previous.xlsx]

(ooxml, embedded labels, table is [2016Budget]);

marcus_sommer

With an inline-table it worked:

QUALIFY *;

t: load [a w], peek([t.a w]) as b, previous([a w]) as c inline [

a w

10

20

30];

UNQUALIFY *;

exit script;

Loading from an excel might require a slight different syntax whereby I suggest to rethink the whole qualify-approach then there is rarely an added-value with them rather the opposite with various problems, see also: Re: qvd's

- Marcus

Not applicable
Author

sorry to say but i need answer for external data instead of Inline

Not applicable
Author

in my first post (number 4) i already tried with single quote but no use

sunny_talwar

I guess what Marcus meant was that you can use this:

Previous([2016 Budget]) As funcBudgetPEEK

marcus_sommer

Please provide an excel data-example and take also into account that developing datamodels in qlik is much easier without qualifying which is even by mid-sized data-architectures not enough to control and overview the data-sources.

- Marcus

Not applicable
Author

i am in practice of qlikview. so i was practicing on different charts and functions in one .qvw file instead of separate .qvw.  function is working Good without Qualify statement. thanks Marcus for ur words 'developing datamodels in qlik is much easier without qualifying'. i removed Qualify statement and practiced in different .qvw file, its working fine