Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sankar_ganesh
Partner - Contributor III
Partner - Contributor III

How to add fields dynamically in the script

Hello,

I want to convert the Table1 into Table2 , as given below. This needs to create fields dynamically in Table2 based on the counts of 'Code' aggr. by 'Date' in Table1.

Does anyone have any idea to implement this..

Table1:

DateCode
5/8/2013a
5/8/2013b
6/8/2013c
6/8/2013d
7/8/2013e
7/8/2013f
8/8/2013g
8/8/2013h
9/8/2013i
9/8/2013j
9/8/2013k
10/8/2013l
10/8/2013m
10/8/2013n
10/8/2013o

                                      

 

Table2:

DateF1F2F3F4
5/8/2013ab
6/8/2013cd
7/8/2013ef
8/8/2013gh
9/8/2013ijk
10/8/2013lmno

Thanks,

Sankar

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached qvw


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

See the attached example.


talk is cheap, supply exceeds demand
sankar_ganesh
Partner - Contributor III
Partner - Contributor III
Author

Hello Gysbert,

thanks for you help. Here the important point to be noted is that the no. of fields in Table2 depends on the max. no. of count of code per day.

in the above example,at any day if i get max. count of codes per day is 6 then fields F1,F2...F6 need to be created, if it is 20 on the next day then F1..F20 have to be created. is it possible ?

Gysbert_Wassenaar

See attached qvw


talk is cheap, supply exceeds demand
sankar_ganesh
Partner - Contributor III
Partner - Contributor III
Author

Thanks Wassenaar, this is exactly what i wanted !!