Discussion Board for collaboration related to QlikView App Development.
i need to get the count of two columns from same table and put it into separate table.
For this i have to write a script so please help me on this.
Thanks in advance
Try like this
Load ProductID, Category, Product From tablename;
Load ProductID, Count(Product) As ProductCount Resident MainTable Group by ProductID;
Load ProductID, Count(Category) As CategoryCount Resident MainTable Group by ProductID;
Forget to give group by
If it is to be added to another table then go for join or concat
Else just you want to get it in another table with same data then the one provided by Mayil is best
You can try below, But you should have a Key field to join these counts to rest of the data model and for that you would need to use the Group By Clause.
LOAD * INLINE [
ProductID, Category, IsTraded, IsShipped
123, Iphone, 0, 0
124, samsung, 1, 1
125, Iphone, 1, 0
126, Iphone, 1, 1
127, Iphone, 1, 1
sum(IsTraded) as TotalTraded,
sum(IsShipped) as TotalShipped