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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

problem using exists function

Hi

I have a problem which i can not understand :

I bring calendar from table DB using Exist function as follow :

CALENDAR:

LOAD "Date_Calander",

     "Year_Num",

     "Month_Num",

     "Quarter_Num",

     "Calander_Presenet_Date"

     WHERE exists(Date_Calander,Date_Calander);

SQL

select distinct CONVERT(varchar(10),a.Date,103) as Date_Calander,

               DATEPART(YEAR,a.Date) as Year_Num,  

      DATEPART(MONTH,a.Date) as Month_Num,

      DATEPART(QUARTER,a.Date) as Quarter_Num,

      LTRIM(RTRIM(convert(char,(DATEPART(MONTH,a.Date)))))+'-'+LTRIM(RTRIM(CONVERT(char,DATEPART(YEAR,a.Date)))) as Calander_Presenet_Date

      FROM EPICPDW.dbo.Fiscal_Calendar a;

If i do full reload i dont get this CALANDER table (it is Disappeared , not exist)

  i guess mayby the exists function did not return nothing (which is not possible)

But if i do a Debug (step by step , only 10 rows ) suddenly CALENDER table create .

How can it be ??

thank you

2 Replies
swuehl
MVP
MVP

Sharon_kabra,

if you haven't loaded any field values for Date_Calander prior this code snippet, the exists() function will always return false, because it determines whether a specific field value exists in a specified field of the data loaded so far.

What are you trying to achieve here?

[I have no idea why you get some data loaded in using the script debugger, though]

Regards,

Stefan

Not applicable
Author

hi

yes i did load field value for Date_Calander earlier (previous tab)

i just want to restrict and get the relevat month and year.

i use debugger to see if there is any problem , but there is no problem, it rerurns row for calander

it only happens when i reload