Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Expression.Error We cannot convert the value null to type logical

I am getting an issue when I try to filter a certain column. This column is added and the code is as follow 

if Date.Month([date]) < Date.Month(Date.From(DateTime.LocalNow())) then 1 else Date.Day([date]) 

In the first image is before I tried to filter. I would like to point out that when I load all values it goes empy (see second image). The error message I get is 

 

Expression.Error: We cannot convert null to type logical.
Detail:
Value=
Type=[Type]

 

 

   

   

 
 
 
 
 
 

 

 

 

 

  • It's hard to say. Most likely there is a step earlier in the query that triggers an error in a row that is not loaded in the preview. PQ loads 1,000 rows and uses those to help you write the query. But if something strange happens after row 1,000  can happen. Look for "changed Type" steps on your date column. Go to the step prior and then click the drop down list like you showed. This should load the full list so you can identify the issue. Also you could force column profiling to load the entire data set. This option is on the bottom left. Change if from 1,000 to all data. This my also help. 

1 Reply

  • MattAllington's avatar
    MattAllington
    Community Champion

    It's hard to say. Most likely there is a step earlier in the query that triggers an error in a row that is not loaded in the preview. PQ loads 1,000 rows and uses those to help you write the query. But if something strange happens after row 1,000  can happen. Look for "changed Type" steps on your date column. Go to the step prior and then click the drop down list like you showed. This should load the full list so you can identify the issue. Also you could force column profiling to load the entire data set. This option is on the bottom left. Change if from 1,000 to all data. This my also help.