Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
joeybird
Creator III
Creator III

handling nulls

Hi

loading in two SQL tables

Table 1 - Survey - Names the surveys the customer has completed

Table 2 - Main - Main Customer Table

when I load in these two sql tables, some CustomerID wont have completed a survey, and survey name appears as null - as expected

I have working Count(if([SurveyName]=0,[SurveyName])) on a table chart. , this limits the CustomerIDs that have not completed a survey

However I want to be able to count how many CustomerID, that have a Survey Name as null in a KPI

with something like

Count(if([SurveyName]=0,[SurveyName])) CustomerID)

but it does not work

I have tried too replace the nulls so they are selectable with no joy

SET NullValue = 'No Survey'

NullAsValue "SurveyName"

please help


14 Replies
joeybird
Creator III
Creator III
Author

Hi

this don't work either

says "SurveyName" field not found

survey Name field does not appear in both tables

please help

vinieme12
Champion III
Champion III

can you post your script?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

or some sample app or sample data?

Preparing examples for Upload - Reduction and Data Scrambling

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
joeybird
Creator III
Creator III
Author

Hi

I cant but here are some sample tables

SQL Table Survey:

CustomerID    SurveyName

1                     Customer Service

3                     Customer Service

4                     Customer Service

5                     Customer Service

SQL Table Main

CustomerID    Name   Surname

1                     John     Smith

2                     Joe       Bloggs

3                     Jane     Williams

4                     Sam     Morgan

5                     Liz        Smith

Should Return

CustomerID    Name   Surname    SurveyName

1                     John     Smith         Customer Service

2                     Joe       Bloggs        Null

3                     Jane     Williams     Customer Service

4                     Sam     Morgan      Customer Service

5                     Liz        Smith         Customer Service

null count in KPI should be 1 , but no joy

please help

vinieme12
Champion III
Champion III

Check the Attached, you can now filter customers with no survey

survey2.PNG

survey.PNG

temp:

Load * inline [

CustomerID,SurveyName

1,Customer Service

3,Customer Service

4,Customer Service

5,Customer Service

];

JOIN

Load * Inline [

CustomerID,Name,Surname

1,John Smith

2,Joe Bloggs

3,Jane Williams

4,Sam Morgan

5,Liz Smith

];

NoConcatenate

FACT:

LOAd * ,

if(isnull(SurveyName),'NA',SurveyName) as NewSurveyName Resident temp;

Drop Table temp;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.