Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have 2 tables and I would like create a field which use one field in the first table and one field in the second table.
Table 1 :
LOAD COACTREF, //Key with TYPEACTIV
Year(DTJRNCAL) as [Année],
Month(DTJRNCAL) as [Mois],
Week(DTJRNCAL) as [Semaine],
Day(DTJRNCAL) as [Jour],
DUREEREA;
SQL SELECT *
FROM ACTIVITY;
Table 2 :
LOAD COACTREF, //Key with ACTEMPJRN
INCALCUL;
SQL SELECT *
FROM TYPEACTIV;
Fields I would like create are :
- If (Table2.INCALCUL = 'O',Table1.DUREEREA,0)
- If (Table2.INCALCUL = 'N',Table1.DUREEREA,0)
Thanks to your help
Sorry ... forgot the drop table
DROP TABLE TEMP;
This way the TEMP table is removed and only the Table is in the application.
The tables are connected with the key COACTREF, so I think the if statement should just work fine as it is.
I assume you use the if statements somewhere in the frontend of the QlikView application (in a pivot table?) ... give it a try I should say.
Thanks to you answer but I would like create fields in the script. I don't want to create fields everytime.
You could consider something like this:
Temp:
LOAD COACTREF,
Year (DTJRNCAL) as [Annee],
Month(DTJRNCAL) as [Mois],
Week(DTJRNCAL) as [Semaine],
Day(DTJRNCAL) as [Jour],
DUREEREA;
SQL SELECT * FROM ACTIVITY;
LEFT JOIN
LOAD COACTREF,
INCALCUL;
SQL SELECT *
FROM TYPEACTIV;
Table:
LOAD COACTREF,
Annee,
Mois,
Semaine,
Jour,
DUREEREA,
INCALCUL,
if(INCALCUL = 'O', DUREEREA,0) as INCALCUL_O,
if(INCALCUL = 'N' DUREEREA,0) as INCALCUL_N
RESIDENT Temp;
Don't see why you should do it this way ... since the tables are connected with the COACTREF
the INCALCUL is already connected to the DUREEREA of the same COACTREF of the other table (oke now it is in one table) ...
If you mean otherwise could you be more specific?
Thanks for you answer.
QlikView create two tables : temp and temp-1, is it normal ?
Sorry, QlikView create 2 tables : Table and Temp.
But I don't want see the table Temp, how can I make ?
Sorry ... forgot the drop table
DROP TABLE TEMP;
This way the TEMP table is removed and only the Table is in the application.
Thanks