Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Here is a pdf attachment explaining my problem.
Thanks in advance for your help.
Waïl Riachi
I took a look at the shared .PDF and there are a lot of information there. If my understanding is correct the overall use case scenario is:
From the information that you have provided it looks that the issue is most probably coming from the dataset and I suspect that it could be related to the difference in formatting. Qlik Sense is using the same interpretation for the loaded values, so if the values provided are indeed the same then there shouldn't be any issue, especially if the reload is being done in exactly the same Qlik Sense software (where the version is the same, environment is the same etc.)
First we should investigate the values from the data source, before they are loaded into Qlik Sense, and then check why they are interpreted differently. Because the issue could be with the format of the value, the connector that is retrieving the data from the database, the Qlik Sense interpretation etc.
Can you please provide the following information?
For the number 5, please avoid sharing any sensitive data. It will be very helpful to see how the data looks like in the database, but it is not required to see the entire dataset. For example you can share a screenshot like that:
This way, we can clearly see how the values look like inside the data source, but as data it is not exposing any sensitive details. But this screenshot should be coming directly from the database, because we first need to see how the data looks like before arriving to Qlik Sense.
Hi @Andrei_Cusnir,
1- AMER OnPrem PTP with QlikSense April 2020 version
2- I use a direct connection to a database in "Data Connection" in ODBC (see attached screenshot)
3- the date is well recognized when I import excel extractions I have never had a problem but with the connection to the database there are date recognition problems (probably because there is more date and these famous "NULL" dates which are translated into 1/1/0001
4- We will implement August 2021 version.
5-
6 - the data come from 2 different tables of the database which are linked together
Thank you in advance,
Regards,
Waïl Riachi
Hello,
I was taking a look at the new information that you have provided. Here are my current assumptions and observations:
Next steps moving forward:
Workaround:
If you don't want to use Data Load Editor in your original application, then you can do a workaround:
Hello @Andrei_Cusnir
The format you see from my database is the format that Oracle (sqlDeveloper) decides to display (DD / MM / YYYY HH: MM: SS). However, just because Oracle decides to display the format like this does not mean that the data is saved and recognized in that format by QlikSense. Unless I am mistaken, QlikSense tries to recognize date fields thanks to QlikSense's natural script which is entered in the data load editor tab: TimestampFormat: 'M / D / YYYY h: mm: ss [.fff] TT' and DateFormat: 'M / D / YYYY' hence the fact that we see on my QlikSense table that my data is in the format 'M / D / YYYY h: mm: ss [.fff] TT' while on the screenshot from the database we see the format DD / MM / YYYY HH: MM: SS.
Now the question is: what is the format that QlikSense considers as date and puts the calendar logo icon next to the variable name once recognized? Like for example my variables r_modify_date and r_creation_date which have been recognized in date format and which have the calendar logo next to their name and yet they are structured exactly the same way as the other variables not recognized as date. Sometimes, the dates are recognized as date but there is not the calendar logo but an arrow allowing to have the expression functions (Month, Year, YearQuarter etc.) however, since there is no the calendar logo, there is no autoCalendar function and I need it to make my graphics
Come then the only solution is that the variables recognized as date are the variables which do not contain NULL data, I could see that in the database some date fields were 'non nullable', therefore when they were null the system (documentum) automatically filled in the fields with the date '1/1/0001'. The problem is that QlikSense doesn't seem to recognize dates in "1/1/0001" so you have to convert these dates to null date. I tried by adding calculated fields but when we create a calculated field we cannot modify its format (date, timestamp) and the calendar logo still does not appear ... so I cannot have it the autoCalendar on these calculated fields. The only solution therefore seems to be to write a script in the dataload editor which only retrieves non-null date data or which converts null (1/1/0001) to true null date (null date) which is recognized by QlikSense normally . While displaying my fields I sometimes have both "1/1/0001" in the "Table" chart and both "empty" data where there is nothing.
I think if the problem is not with "1/1/0001" it is rather caused by this empty data which is not recognized as null date (null date). If you have scripts to advise me, I would be happy to because I do not master the language of QlikSense and I have never written a script apart from the creation of expressions (measures). You will find attached a sample of data with which you can do your tests (once you have the calendar logo next to all the date fields, you will have succeeded) 😉
Thank you in advance,
Good luck !
Waïl Riachi
Hello,
Thank you very much for all the information. You are absolutely right about the values that are stored in your Oracle database and why they are displayed the way they are. My responses contain mainly assumptions about what could possibly go wrong since I don't have the exact same setup on my side and the exact same dataset.
I took a look at the dataset that you have provided and I was able to reproduce the same issue that you have. Which means that we are on good point. During my investigation, while I was playing with the provided dataset, I have found some interesting observations. Here are the results of my investigation:
I assume that the data you have provided in the EXCEL is exported from the database, which means that instead of having null values, you are having -1. Qlik Sense is trying to interpret the values as dates and then it finds the number -1 which is confusing. This is why in your case you are getting a weird date as '1/1/0001', since it is failing to interpret it properly. Also I believe that in your use case scenario Data load editor is not going to help you, because you want to load the dates and let Qlik Sense apply the autoCalendar on them. This "Problem with creating calendar measure. No date fields detected" [1] article, explains that if you want the autoCalendar then you have to load the data with Data manager.
Your dataset looks like this:
This is how the data looks after I have removed the "-1" from the dataset in EXCEL and reloaded:
I hope that this information was helpful.
---
Hello @Andrei_Cusnir,
Hello, Thank you for your analysis. I am fully aware that Excel recognizes "Null" dates in "-1" it is precisely thanks to this test that I understood where the problem came from: the bad interpretation of the null dates in my database. data. However, my database is connected directly to QlikSense so it doesn't go through Excel and I don't know if QlikSense considers them as "-1" like on Excel. Rather, he seems to think of them as "1/1/0001". So the question is, how do I tell QlikSense to properly recognize dates in my database?
And for information, I have never used the Data Load Editor to load my data, I am all the time spent by the Data Manager.
Thanks in advance,
Regards,
Waïl Riachi
Hello,
Thank you very much for sharing with me this information. I am not an EXCEL expert, therefore my investigation results are based on everything that I was able to reproduce or find in the official Microsoft Office documentation. Please find below the findings of my investigation:
As you can see, through my reproduction attempts it seems that NULL values were interpreted differently in different environments. In my database the value was displayed as “[NULL]” but when exported it was displayed as “NULL” text. In Qlik Sense the NULL value was presented as “-” and when exported, it was presented as “-” as well. However, you can see that when writing a custom script that writes the exact NULL value in the EXCEL file, the value is not interpreted as “-1” by EXCEL as you have mentioned in your last response. Therefore, in your use case scenario, when you have exported the data from your database, then during the export process most probably the null values were exported as “-1” instead of NULL.
Qlik Sense doesn’t have a full control over the ODBC connector, therefore many things can play a role in why the data is loaded the way it is. To troubleshoot further the issue there are some options that you can try. I understand that you haven’t used Data load editor and you were only working with Data manager, however this will probably help with the investigation. If you are not very familiar with Data load editor and you can’t follow some of the recommendations mentioned below, I would suggest you to search online for simple tutorials on how to use it with basic Data load editor and also check other topics in Qlik Community. This will help you troubleshoot better the current issue and at the same time it will allow you to have more freedom and control over your dataset loading in the future.
Please share with us the following information:
---
[2] https://www.devart.com/odbc/sqlserver/docs/excel.htm
Hello @Andrei_Cusnir ,
Thank you very much for your answer !
I am not loading my data with Excel but directly with a database connection to QlikSense. I wouldn't mind loading my data through the data editor if that's the only solution. But I would like to know how to do it and if possible send me the code to put so that I simply do a copy paste because I do not want to waste my time yet to train myself on this it already makes more than one While I am on this QlikSense issue I would like it to be resolved ASAP. And no we have not upgraded to the latest version of QlikSense because we will most likely give up our Qlik licenses and switch to another viewer if this problem cannot be resolved.
Thank you in advance for your help,
Regards,
Waïl Riachi