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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

Convert SQL to Qlikview

Hi Community,

could you help on below..

SQL to Qlikview:

Select *  from Category where

CreateDate =Case IF(DayName(ModifiedDate)='Monday' then ModifiedDate 

I have tried like..

Where CreateDate = IF(WeekDay(ModifiedDate)='Mon', ModifiedDate), giving wrong result

 

Thanks in Advance....!

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you are loading data from an sql database then you must use the sql dialect that your database server understands. You can't use Qlik script language because your database won't understand it.

If you're loading data from a file or another table that's already loaded then you use the LOAD statement. In that case the where clause you posted should work. If that gives a wrong result then we'll need more information. Can you post a small qlikview document that demonstrates the problem?


talk is cheap, supply exceeds demand
paulwalker
Creator III
Creator III
Author

I can use same query in Qlikview, but I'm not using SQL query, some one has provided that query. I need to convert into Qlikview.

is this correct Where condition, anything wrong??

Load * from category  Where CreateDate = IF(WeekDay(ModifiedDate)='Mon', ModifiedDate-3, ModifiedDate-1)

 

 

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Select * from category  Where CreateDate = IF(WeekDay(ModifiedDate)='Mon', ModifiedDate-3, ModifiedDate-1)

You are using SELECT. That means you MUST use the SQL dialect that your database server understands. Your database server DOES NOT understand Qlik script language like the WeekDay function. Therefore DO NOT USE Qlik functions in sql statements. 

 

 


talk is cheap, supply exceeds demand