Discussion Board for collaboration on QlikView Scripting.
Guys, I need your help..
How to write script for edit record on QVD?
Go to Solution.
Cost_Centre, Periode_Report, Amount,
and Map_1 <> 'Expense'), 'Other',Map_1) as Map_1,
and Match(Map_2, 'OPEX'), 'Other OPEX',Map_2) as Map_2
You cannot directly update a QVD instead you need to recreate it again like this
If(Map_2 = 'Opex', 'Other', Map_2) AS Map_2
STORE Data INTO QVDFileName.qvd;
Hope this helps you.
Hi Valdi, there is direct way to edit the record in the QVD.
First you have to load the QVD and edit the record withe ApplyMap or LookUp or If condition. I personally use ApplyMap because its relatively very fast.
First create the Mapping Table with your edit field values.
MAPPING LOAD * INLINE [
LOAD A, B, C, ApplyMap('MAP_EDIT', Map_2 , Map_2) AS Map_2
From QVDNAME.qvd (qvd);
STORE QVDNAME into QVDNAME.qvd (qvd) ;
DROP Table QVDNAME ;
how to edit record for example:
If(Map_2='OPEX','OTHER',MAP_2) as MAP_2
store Data into QVDFileName.qvd
and I want to keep data 2013, and just data 2014 has changed?
Try like this
If(Year(DateFieldName) = Year(Today()) AND Map_2 = 'Opex', 'Other', Map_2) AS Map_2
Replace DateFieldName with your date field name.
Can You give me write example Year Date?
Field1, Field2, If (Year(DatePeriode_Report)=Year(Today())) and Map_2='Opex','Other',Map_2) as Map_2 ?
Record Periode Report='2013011','2013012','2014001','2014002','2014003'
how to write the scrip for YearDate?
Can you attach some sample data and expected output? or try this
Field1, Field2, If (Left(DatePeriode_Report, 4)=Year(Today())) and Map_2='Opex','Other',Map_2) as Map_2
Thank you Mr.Jagan Mohan.
Please close this thread by clicking Correct and Helpful Answer buttons to the posts. It helps others in finding the answers for similar requirement.
I'm sorry, I have the last question. how to write script if
Map_3=('Depreciation','Fixed Assets','GA Exp'),'Other',Map_3) as Map_3? <<-- is it true?
I want to edit 3 differrent record ('Depreciation','Fixed Assets','GA Exp') to 'Other' furthermore Map_3