Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ym
Contributor II
Contributor II

Date

Hello 

I need a dimension with all dates. Not only dates with data. How to do this in the load script?

ym_1-1677588709938.png

 

Labels (3)
1 Solution

Accepted Solutions
henrikalmen
Specialist
Specialist

I got more of the script in a DM, thanks. That part creates the table LinkTable, and that table has the %Datum field that should make it connect to the MasterCalendar table. And there's nothing in there affecting the MasterCalendar at all.

Unfortunately I think I'm running out of ideas. What I would do in your situation is to try to debug step by step by using, and moving, "exit script;" in load script. On a single line in load script after the master calendar is created you write
exit script;

Reload the app, check the data. The MasterCalendar table should have all the expected rows. Go back to script editor and move the "exit script" statement so that it is placed under the next event (or at least a later event) in your load script where it is possible to stop. Maybe it is after the first part of creating the LinkTable. Check the MasterCalendar table again. And then you move through your script like that until you suddenly notice that the MasterCalendar table is not what it should be anymore. I think you get what I mean. If the MasterCalendar table actually loses rows during reload, it must happen at some specific point. This way you should be able to find that point.

View solution in original post

9 Replies
henrikalmen
Specialist
Specialist

Search for Master Calendar in the community, or google qlik master calendar to get some ideas.

ym
Contributor II
Contributor II
Author

I have a Master calender. 

 

But when I load my master calender and the the other tables I get only the dates with data

henrikalmen
Specialist
Specialist

Ok, so then you should be able to see all dates if you add a filterpane to your sheet, or if you have a chart with the just the date field dimension (or with just an expression like sum(1) ).

I am guessing you are not seeing all the dates in your table because of a measure that gives null values, and the dimension is set to hide those rows. If you check your dimension(s) in the chart, is the checkbox "Include null-values" checked? If it isn't, check it and see if you get the result you want.

ym
Contributor II
Contributor II
Author

Tanks for your help. I have 0 active filters and in the dimension include the null values. 

The problem is, when I load only the master calender I have all dates. But if I load the mastercalender together with my other tables, then my dates are incomplete. How to solve this?

 

 

henrikalmen
Specialist
Specialist

Are the dates actually missing from your master calendar table, or do they exists in the app (so you can see them if you add a filterpane with the date field) but you don't see them in your frontend table?

ym
Contributor II
Contributor II
Author

If I run the whle script then some dates are missing. I should have  2600 unique dates ( 01-2017 until now+1 year). But I only have 1705.

 

ym_0-1677612453840.png

If I only load the mastercalender and then exit scrip; then my mastercalender has all dates

ym_1-1677612683972.png

I don't understand why qlik removes the dates without values.

 

henrikalmen
Specialist
Specialist

Could you post your loadscript here?

henrikalmen
Specialist
Specialist

That's the master calendar script, and you already said it is working. But you say that when loading additional tables, something happens to your master calendar table. So I'm more interested in the rest of the load.

henrikalmen
Specialist
Specialist

I got more of the script in a DM, thanks. That part creates the table LinkTable, and that table has the %Datum field that should make it connect to the MasterCalendar table. And there's nothing in there affecting the MasterCalendar at all.

Unfortunately I think I'm running out of ideas. What I would do in your situation is to try to debug step by step by using, and moving, "exit script;" in load script. On a single line in load script after the master calendar is created you write
exit script;

Reload the app, check the data. The MasterCalendar table should have all the expected rows. Go back to script editor and move the "exit script" statement so that it is placed under the next event (or at least a later event) in your load script where it is possible to stop. Maybe it is after the first part of creating the LinkTable. Check the MasterCalendar table again. And then you move through your script like that until you suddenly notice that the MasterCalendar table is not what it should be anymore. I think you get what I mean. If the MasterCalendar table actually loses rows during reload, it must happen at some specific point. This way you should be able to find that point.