Direct Discovery doesn't load any record from the Direct table. It just examines the fields you write down in this Select only for associating with other tables in your model.
The Direct table is created, but empty. During execution, any time QlikView needs the values it runs a SELECT statement against the ODBC to retrieve the needed records. But during reload, there is no records to load.
I presume that your employee table is not massive - in which case you probably don't want to be doing a DIRECT select from it.
This keyword sets the table up to be used in direct discovery mode - that is that the data from the table is retrieved when the user is using the application rather than at load time.
If you are not intending this to be the case for employees remove the DIRECT prefix and see if that then gives the results you are expecting.
The DIRECT statement is only required for massive tables, where you don't want to store all of the information in memory. Unless you are talking more than tens of millions of employees you don't need to be using it there!
Without the DIRECT prefix you should get the data you require.
It looks like you may have a bug in your script though, where you have Date In and Date Out in single quotes. These will be treated as literal strings without column names, and two unnamed columns will probably cause QlikView to bail. You are probably wanting to use square brackets around the field name instead?
Thank you but there is no bug.
Everything works well (better than my brain).
I thought i could see raw data, but according to Juan's explainations, i understood it is not possible.
However i can count any data coming from Direct table using data from Emp table as dimensions.
I understood it is for a big amount of data but i was just testing.
Behind the scenes QlikView will be getting a distinct list of key values from the underlying table to join the data that will be pulled directly into the rest of your in memory data model. I'm not sure if you can query that in order to get a count of rows.
The simplest route would be to push the query back to the database and simply do a count there:
COUNT(*) as EmpRowCount
You can then use PEEK to put that into a variable, if required.