Discussion Board for collaboration related to Creating Analytics for QlikView.
I want to calculate count of column1 from table 1 then check the value of column 4 of table 2 and assign the above calculated count to this column.
eg:if(column4='abc' then count(column1))
if(column4='def' then count(column1))
how can i do this in scripting?
if(column4='def' ,column1)) as fieldname
from path group by column4;
hope this helps
I have already loaded table 1 and table 2 seperately. so shall i write the above script while loading table 2 or perform a resident load?
you need to join two tables
then in resident load you can write the above code
I cannot perform a join of the tables cause both the tables are linked to multiple tables and it may result in loss of information...
you leave two tables as it is
but resident of one table you can load with two fields key field and column 1
then you can add one field to onther table based on key field usng mapping load
when you add column1 into table where you column4 then easily you can apply condition in above post.
hope this help
If I understand your question correctly, this is what you are looking for:
BaseTable:Loadcolumn1,column2,column3,column4From******;ColCount:LoadCount(column1) as Col1CountResidentBaseTable;Let vColCount = Peek('Col1Count');Drop Table ColCount;NewTable:Loadcolumn1 as col1,column2 as col2,column3 as col3,If(column4='abc',$(vColCount),$(vColCount)*10) as col4ResidentBaseTable;
Count(column1) as Col1Count
Let vColCount = Peek('Col1Count');
Drop Table ColCount;
column1 as col1,
column2 as col2,
column3 as col3,
If(column4='abc',$(vColCount),$(vColCount)*10) as col4