Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

exist function does not work

Hi all,

I am missing something here. The exist function works correctly when I use the same fieldname in both tables, but when I try to use when referring to another field with "where Exists(PostingDate, 'Month to close')" it does not work. Any ideas?

LOAD [Month to close] // as PostingDate  --> If I rename it, the exist function works!

FROM

Month End Closing Process.xlsx //modified

(ooxml, embedded labels, table is [Month to close]);

LOAD //PostingDate as [Month to close],

          PostingDate,

  AmountOriginal   

FROM

CF_Data.qvd // (!!! modified)

(qvd)

where Exists(PostingDate, 'Month to close')

thanks a lot!

1 Solution

Accepted Solutions
gandalfgray
Valued Contributor

Re: exist function does not work

As Sridhar said the first fieldname in the Exists() should already be available before the loading of the current statement, the second fieldname is used when the field to compare in the current load is named something else than what is already loaded.

use:

where Exists([Month to close],PostingDate)

and in case you also want to associate the fields with eachother the complete statements would be:

LOAD [Month to close]

FROM

Month End Closing Process.xlsx

(ooxml, embedded labels, table is [Month to close]);

LOAD PostingDate as [Month to close],

         AmountOriginal   

FROM

CF_Data.qvd

(qvd)

where Exists([Month to close],PostingDate);

/gg

3 Replies
sridhar240784
Contributor III

exist function does not work

Hi

It should be like this.Exists(Frist Table Field Name,Second Table Field Name)

                     where Exists('Month to close',PostingDate)

-Sridhar

SunilChauhan
Esteemed Contributor

exist function does not work

try this

LOAD [Month to close] as PostingDate  --> If I rename it, the exist function works!

FROM

Month End Closing Process.xlsx //modified

(ooxml, embedded labels, table is [Month to close]);

LOAD PostingDate as [Month to close],

          PostingDate,

  AmountOriginal  

FROM

CF_Data.qvd // (!!! modified)

(qvd)

where Exists(PostingDate, [Month to close])

gandalfgray
Valued Contributor

Re: exist function does not work

As Sridhar said the first fieldname in the Exists() should already be available before the loading of the current statement, the second fieldname is used when the field to compare in the current load is named something else than what is already loaded.

use:

where Exists([Month to close],PostingDate)

and in case you also want to associate the fields with eachother the complete statements would be:

LOAD [Month to close]

FROM

Month End Closing Process.xlsx

(ooxml, embedded labels, table is [Month to close]);

LOAD PostingDate as [Month to close],

         AmountOriginal   

FROM

CF_Data.qvd

(qvd)

where Exists([Month to close],PostingDate);

/gg