Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi qlikss,
Need some expalanation
i have calendar script:
LOAD
min(datefield) as DateMin
,max(datefield) as DateMax
;
LOAD
FieldValue('date', RecNo()) as datefield
AutoGenerate FieldValueCount('date');
to find max and min values of date, we can directly use max,min functions.why we need last 2 lines in calendar script.
I mean these 2 lines
LOAD
FieldValue('date', RecNo()) as datefield
AutoGenerate FieldValueCount('date');
Yes. you are right. Is there any special purpose to create table with all dates rather than just using your option
i mean your first option
You could skip the 2 lines if you direct pull data from the table with the field 'date'.
LOAD
date(DateMin + IterNo()) as [date]
WHILE DateMin + IterNo() <= DateMax
;
LOAD
min(datefield)-1 as DateMin
,max(datefield) as DateMax
RESIDENT [Your table name];
Nope, I don't think so. If there is a reason then it is performance wise. Maybe on large dataset MIN / MAX on the resident table is slower the just creating a list of all dates that exists in your source table. In that case you only have one field in your table instead of all the other fields. Less columns are faster than a lot of columns. And only loading unique values creater lesser rows and lesser rows are faster then a lot of rows.
If you're working with a small dataset don't worry. If you have a large dataset. Try both ways and check the time needed for the reload.
I have one more doubt. If i reloaded qvw with just these 2 lines
LOAD
FieldValue('date', RecNo()) as datefield
AutoGenerate FieldValueCount('date');
I got result like this.
why datefield has all ? marks instead of dataset
I suggest you should check the formatting of the field: [datefield]. Maybe the format isn't correct and it shows a ?. You could also check the table viewer. there you can see the values just as they are (without any format).
Yes, you are right. Got it thank you.
Yes formatting is not right. Thank you
Thanks for your patience and detailed explanation
A.M. van Keep
No Problem. You're welcome.