Discussion Board for collaboration on QlikView Scripting.
Does anybody know how to manually add a ‘field’ (column) in QlikView which is not there in the load file?
Your load file has only column “CTC” and I would like to add a field “Monthly” (say to find the monthly take home) in the QV script, how do I do it?
a) I tried to directly add it in the script but it spits out an error.
b) I am fetching the data from a qvd file. Is the issue because of this?
Go to Solution.
Yes, this has to be there in the script. For age(in days) you can try like:
Today() - DOB as AgeInDays
From <data source> ;
Note: your DOB field here has to be proper date field.
Try something like :
CTC/12 as Monthly
From <your qvd> ;
If this doesn't help, let know the code you are trying with and error .
@Tresco.. I think that's a good idea..
Let me try that..!!
But wouldn't that come in the expression script pane than in the loading script pane?tresesco
Secondly, Can you tell me how do I find age of students in days as of today.. like Today() - DOB
What should I write in the load script when DOB is a column having 100 dates of 100 students?
Try with Age() function to calculate the age..
Interval(Today() - DOB, 'd') for days.
Hi tresesco Mayil Vahanan Ramasamy -
Thanks for your replies.. I tried both your options but in the Load script, I am not able to pick the column name "DOB".. It is not appearing in the drop down...
Can you upload the sample file?
tresesco Mayil Vahanan Ramasamy - Worked well!! thanks....
One Last question...
I need to bucket these number of days now..
the buckets are say - 0-7, 8-30, 31-60, 61-100, >100
how do i script this?
Had the buckets been equi-distant, you could have used class(). Otherwise, you have to try with If-Then-Else. Like:
Today() - DOB as AgeInDays,
If( Today() - DOB<8, '0-7' , If( Today() - DOB <31, '8-30' , If( .....))) as Buckets