Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I have a Qlik Sense with three .txt data files. Each of the .txt data files has three fields in commom: Utilizador (Username), Data (Date), and Programa (Program).
I woould like to have a field block on my sheet which filters all graphics with data from any of these three files.
How can I get a date field which merges all three and thus affects all graphics from any of the 3 data files?
You may notice that the Username field (Utilizador) and the Program field (Programa) are both successfully filtering all graphics. I would like that to happen to the date field as well.
I have tried to associate the Date fields but everytime I try that it dissassociates the other Username and Program fields...
data1: load *,Utilizador& Programa& Data as join_key inline [ Utilizador,Data,Hora,Programa,Comando rita.aguiar,04/02/2019,09:00:00,Autodesk AutoCAD 2019,iniciar rita.aguiar,04/02/2019,10:00:00,Autodesk AutoCAD 2019,encerrar rita.aguiar,04/02/2019,10:00:00,Autodesk AutoCAD 2019,iniciar rita.aguiar,04/02/2019,11:00:00,Autodesk AutoCAD 2019,encerrar rita.aguiar,04/02/2019,11:00:00,Autodesk Revit 2019,iniciar rita.aguiar,04/02/2019,12:00:00,Autodesk Revit 2019,encerrar rita.aguiar,04/02/2019,12:00:00,Autodesk AutoCAD Civil 3D 2019,iniciar rita.aguiar,04/02/2019,13:00:00,Autodesk AutoCAD Civil 3D 2019,encerrar ]; data2: load Utilizador& Programa& Data as join_key,Tempo inline [ Utilizador,Programa,Data,Tempo rita.aguiar,Autodesk AutoCAD 2019,04/02/2019,0.266666666666667 rita.aguiar,Autodesk Revit 2019,04/02/2019,0.133333333333333 rita.aguiar,Autodesk AutoCAD Civil 3D 2019,04/02/2019,0.133333333333333 ]; data3: load Utilizador& Programa& Data as join_key , Hora as closing_hour ,Licença; load * inline [ Utilizador,Programa,Data,Hora,Licença rita.aguiar,Autodesk AutoCAD 2019,04/02/2019,09:00:00,1 rita.aguiar,Autodesk AutoCAD 2019,04/02/2019,10:00:00,-1 rita.aguiar,Autodesk AutoCAD 2019,04/02/2019,10:00:00,1 rita.aguiar,Autodesk AutoCAD 2019,04/02/2019,11:00:00,-1 rita.aguiar,Autodesk Revit 2019,04/02/2019,11:00:00,1 rita.aguiar,Autodesk Revit 2019,04/02/2019,12:00:00,-1 rita.aguiar,Autodesk AutoCAD Civil 3D 2019,04/02/2019,12:00:00,1 rita.aguiar,Autodesk AutoCAD Civil 3D 2019,04/02/2019,13:00:00,-1 ];
How about the above . I didn't see the explanation of yours before writing the code
I will tell you what i did. As you have User , date and programme they have to be the join key between the three tables. As the second table is the output of first table we can join it so that we can get the tempo, which will show the time spent by employee ( out of 1).
In the third table the key to join again is the three fields(User , date and programme). The hours when the user summons the license (hour) which is different the hour in the first table hence not joined . and the value is also not joined.
Hope i made sense .Let me know if you need anything else.
Thanks
Pradosh
Thank you @pradosh_thakur
To write those lines of code and create a canonical calendar, do I have to unlock the auto-generated script on the data manager? Because if I do so, then I can no longer edit data on the Data Manager.
I'm doing it on a copy file, just to make sure I don't mess it up...
I tried this: But I don't really know what to put on some of the variables/parameters. I tried to load it but it doesn't work.
Load [Data1.Data], Applymap('Data1.Data',Data,Null()) as CanonicalDate, 'Data1' as DateType Resident OrderLines; Load [DadosHorasTrabalho.Data], Applymap('DadosHorasTrabalho.Data2Data',Data,Null()) as CanonicalDate, 'Data2' as DateType Resident OrderLines; Load [DadosInOut.Data], Applymap('DadosInOut.Data2Data',Data,Null()) as CanonicalDate, 'Data3' as DateType Resident OrderLines; Load [Data1.Data], [DadosHorasTrabalho.Data2Data], [DadosInOut.Data] as CanonicalDate, 'Data' as DateType Resident OrderLines;
@pradosh_thakur
I cannot open the .qvw file on the second link. It says that 'the licence that is embedded in this document is not valid'.
Try adding the canonical code in another tab . don't disrupt/edit the autogenerate section and used your canonical fields. I hope this fits your requirement.
I ended up doing it on the Auto Generated Section, but on a copy file and so the non edited file is safe.
How can I get the variables/parameters right?
I don't understand some of the variables/paramers on the first link https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578. I tried doing my best to interpret it, but it's not working 😞
@pradosh_thakur Yes, as I said, I ended up doing it on the Auto Generated Section of a file copy and so the file is safe.