Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
SRT10
Contributor III
Contributor III

how can i update a column of table in qlikview

I have a table in qlik memory named as final. this holds data from various sources and accumulates total data of around ~ 60,00,000 data.

I want to update column custType2 to Perm when
custType1 = 'Payroll' and
country = 'India' or country = 'Canada'

This should be done within script. as this qvw will be used as binary load by a dashboard.
is it possible to do this quickly and efficiently.
I tried this by left join and if statement but it will taking lot of time to finish.
We do not want to compromise on performance of our extract.

 

Labels (2)
3 Replies
Cascader
Creator
Creator

Try: 

 

Load 

if(custType2='Payroll' and country = 'India' or country = 'Canada', Perm, custType2) as custType2

from 

x;

 

SRT10
Contributor III
Contributor III
Author

This takes lot of time if we use if condition and do resident load as data is in table of qlikview.

Cant we use any mapping using whihc we can achieve this quickly

marcus_sommer

A mapping should be performing better as joins and/or if-loops but it will also break an optimized load. A check is easily done with something like:

m: mapping load * inline [
L, R
Payroll|India, 1
Payroll|Canada, 1];

final: load *, pick(applymap('m', custType2 & '|' & country, 2), perm, custType2) as custType2
from QVD;

This way is only needed if perm is a field - should it be a string-value the single applymap() would be enough.

Even faster would it be if not the entire data-set would be touched else if there were anything to detect which records needs to be changed and which not. Means something like the biggest data-part is loaded optimized with a where exists() clause and only the smaller part is loaded with a transformation.

To get this you will need some additionally measurements like combining custType2 and country in an extra field and/or flagging the wanted value-combination with TRUE/FALSE and maybe some more ...