
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to implement nullif along with cast and coalesce in QlikSense
SQL Query
(select count(distinct(tp.trainerid)) from ptrainer tp inner join calendar tc on CAST(coalesce(NULLIF(tc.trainername, ''), '0') AS integer) = tp.trainerid where tc.calendarid IN (select csu.calendarid from enrolleduser eu group by csu.calendarid)) as performing
Please Accepts as Solution if it solves your query.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Coalesce() is available in Qlik, as are if() and isnull(). For explicit conversion to numbers, num#() is available.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The sql isn't executed from Qlik else just transferred to the database and Qlik received only the result of the query. If the query didn't return your expected results you need to adjust the sql or you may consider just to pull the data-tables from the data-base to Qlik and making the needed transformation there. It depends on the size of the data-set, the network performance and your know how level of Qlik vs SQL which way be more suitable for you.
- Marcus
