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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help with SQL SELECT

Hi all,

I need help with a SQL SELECT statement - here it is:



SQL SELECT creationdate as "Order created",
id_case,
model as "WL_model",
"model_name_long",
"model_name_short",
service,
status,
"subsidiary_registered",
repairdate

FROM "_lordwh_global".dbo."v_case";


Now i want to replace the id_case with something like that:


IF(ISNULL(Sum(id_case)),0,Sum(id_case))


How can I implement such a function in the SQL select?
I want to replace all NULL-values with a 0 from the id_case.

Thanks for help!


12 Replies
Miguel_Angel_Baeyens

Yep, I fix it now

load If(Len(id_case) > 0, 1, 0) AS id_case, model as "WL_model", "model_name_long", "model_name_short", service, status, "subsidiary_registered", repairdate;SQL SELECT creationdate as "Order created", id_case, model as "WL_model", "model_name_long", "model_name_short", service, status, "subsidiary_registered", repairdate FROM "_lordwh_global".dbo."v_case";


Anyway, that error is usually because of a missing "," or ";" depending on the type of load you are doing.

Regards.

Not applicable
Author

Thank you. It's working now, but I still can't get my result I want.
QlikView won't let me select the NULL values ...

Miguel_Angel_Baeyens

Do otherwise, and use the where clause to select all null values:

WHERE Len(id_case) = 0


If this doesn't work, you will have to check how your database works with null values, and how your odbc/driver returns them.

Regards.