Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

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
Highlighted

Re: Where

Hi John,

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

Highlighted
Creator III
Creator III

Re: Where

Hi Nagaraj

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

Unexpected expression  error ')..

Iam confused with this

Highlighted
Partner
Partner

Re: Where

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
Highlighted
Contributor III
Contributor III

Re: Where

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

Highlighted
Contributor III
Contributor III

Re: Where

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

Highlighted

Re: Where

Hi John,

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

Highlighted
Creator III
Creator III

Re: Where

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 '<= > 

Highlighted

Re: Where

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.?

Highlighted

Re: Where

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)));

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)