Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Please see attached for desired and current result I am getting when trying to show 0 for all dates with missing occurences for a specific site.
This is my current load script:
Noconcatenate
NewTable:
Load DateKey
Resident Calendar;
Left Join (NewTable)
Load
DateKey,
IF(LEN(Occurence)='-', 0, Occurence) AS OccurenceCount,
Site
Resident Table1;
where do you want it??
1: Front end (UI)
modify your expression
like
if(trim(Occurance)='-',0,Occurance)
2: In Back End (Script)
NewTable:
Load DateKey
Resident Calendar;
Left Join (NewTable)
Load
DateKey,
Occurence AS OccurenceCount,
Site
Resident Table1;
NoConcatenate
Final:
Load DateKey,
if(isnull(OccurenceCount) or len(trim(OccurnaceCount))=0,'0',OccuranceCount) as OccuranceCount,
Site
Resident NewTable;
Drop table NewTable;
Len(Occurrence) always return number format like 0,1...
So, You can think like
IF(IsNull(Occurence), 0, Occurence) AS OccurenceCount,
Thank you for the response. I just realized that I did not include the following in my post that is also part of my load script:
NullASValue *;
Thank you for the response to this. I have tried your suggestion, but still getting the same result.
Thank you for the response. I do need this in the back end. Your suggestion partially worked, I am now seeing zero for all dates where none of the sites have values, but if one site has a value at a specific date and another site does not, I am only seeing the record for the site with a value. See below more details:
I know that is my problem, but asking what is the best way to handle it. My main question should really be, Do I add the fake records in the source file outside of Qlik and then load it, or is there anything I can do in the load script to create the missing records?