Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Where

Hi All,

Iam using the below condition in the script  using where condition ..

Where (Pass_Year= Year(Today()) and Passmonth <= 12) AND (Pass_Year = Year(Today())-1 and Passmonth > 12);

This is giving me error..Please let me know if this is correct or needs to be changed ..

Thanks

10 Replies
tamilarasu
Champion
Champion

Hi John,

The where clause looks fine. What is the error message?

smilingjohn
Specialist
Specialist
Author

Hi Nagaraj

Thanks for the reply ..when I reload this I get a error like

Unexpected expression  error ')..

Iam confused with this

ali_hijazi
Partner - Master II
Partner - Master II

Pass_Year cannot be at the same time Year(Today()) and Year(Today())-1

your condition should be

Where (Pass_Year= Year(Today()) and Passmonth <= 12) OR (Pass_Year = Year(Today())-1 and Passmonth > 12);


One thing to note the Month cannot be greater than 12!!

I can walk on water when it freezes
vineetadahiya12
Contributor III
Contributor III

This condition seems working fine when I tried with some dummy data. Can you share you sample that would make it easy to debug .

vineetadahiya12
Contributor III
Contributor III

The condition is fine seems the issue is in some other part of script

tamilarasu
Champion
Champion

Hi John,

I think the issue is not because of the where condition but some other part. Could you please post your script here.

smilingjohn
Specialist
Specialist
Author

HI Nagaraj.

My full where condition is below

where (Pass_year = Year(Today()) and passmonth <= 12) or (Pass_year = Year(Today())-1 and passmonth > 12)

and [Discription_Date] < if(WeekDay(today()) = 'Fri',today() - 3,     

                       if(WeekDay(today()) = 'Sun', today() - 2, 

                          today() - 1)); 

and the error is like missing field '<= > 

tamilarasu
Champion
Champion

John,

The above where condition is also looks fine to me . It looks like you have problem in passmonth field. Can you please check your passmonth field? Also If possible please share complete load statement.?

Anil_Babu_Samineni

I believe you need this?

where ((Pass_year = Year(Today()) and passmonth <= 12) or (Pass_year = Year(Today())-1 and passmonth > 12))

and ([Discription_Date] < if(WeekDay(today()) = 'Fri',today() - 3, if(WeekDay(today()) = 'Sun', today() - 2, today() - 1)));

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)