Anybody help me to understand MACRO, actually i'm going to create a Macro in QlikView to create "qvd" files for Qlik Sense Server data upload.
Please guide me that how can i start working on this.
Just to make it clear - you don't have to use Macros to create QVD-files. I have made a lot of load scripts and QlikView development without ever needing to use Macros. Macros however have their use - especially to automate things for a developer that is otherwise a time consuming task.
Macros are programmerd in either VBScript or JScript. VBScript is most often used and you can select which in the Module/Macros user interface. Macros can be executed either by calling Macro functions from the load script or by using them from the running QlikView application. In the first case you will not be able to use the QlikView Object Model since a load script does not connect to the running applications UI in any way. Macros in the UI of a running application on the other hand has full access to the QlikView Object Model.
Macros can only be employed and used in QlikView and are not available with any version of Qlik Sense.
This is the secion in the online help that documents how to use Automation and Macros:
Actually the organisation where i'm working right now, some "qlikview documents" are created in "QlikView personal edition" and when we open this file and run script it generates "qvd" file and i put all these "qvds" into Qlik Sense server (Path- C:\QlikSense\SharedDataFolder) and after that run task for data uploading.
Could you explain me about this complete process and I want to create that "qlikview document".
You find most information online actually. It is hard for me to explain anything that is hidden inside the load script of the QlikView application you are using unless you share the load script with us.
This load script:
Most importantly there are no Macros involved in this application. Maintenance and further development has to be done in the load script.
Thanks for reply Petter,
Its my fault i thought this is Marcos.
Now, i'm expecting one more help..actually the file i have posted you is not able to open at my end because getting error which is mentioned below in snapshot, please help me to do the same.
You can forget about the "old" Target_Cross_East.qvw. It is correct what is stated and you can't actually use that qvw anymore. Actually you should consider using Qlik Sense instead - with minor changes you can run the same load script. With Qlik Sense Desktop you will not run into this problem in the future because QVF-files can be shared freely between different users.
Luckily for you I have a copy of the entire load script and that is all that matters. So if you create a blank new QlikView application and open the "load script editor" you can paste the script that I have attached here. After that save the app and reload. Now you have a new version of the app with the same load script that you can continue to use in the future:
SET TimeFormat='h:mm:ss TT';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
LET vFileMonth = 'February2017';
LET vDataDate = '2017-02-01';
LET vStoreMonth = 'Feb17';
MAPPING LOAD DISTINCT
Upper(Depot_id&'|'&Customer_Name) AS key,
MAPPING LOAD DISTINCT
Upper(Item_Name) AS Item_Name,
FOR EACH vDepot IN 'AND','GRN','GZD','IPD','NID','NOI'
[HG 500 ATTA],
[MULTI GRAIN 450],
[SB (1PC) 80],
[HG LONG 250],
[BROWN (2PC) 50],
[MILK BREAD 300GM],
[READY ROTI 200GM],
[HG 450 W],
[BURGER ATTA 250],
[HG 600 E],
[HG 300 E]
(ooxml, embedded labels, table is $(vDepot));
CrossTable(Item, Target, 5)
DROP TABLE tab1;
ApplyMap('Customer_ID_Mapping',key1,'N/A') AS [Cusomer ID];
Upper(Depot&'|'&CustomerName) AS key1,
CustomerName AS [Dealer Group],
Num('$(vDataDate)') AS link_Date
DROP TABlE tab2;
ApplyMap('Item_Name_Mapping',Item,'N/A') AS Item_Cd;
If(Item ='Roti', 'READY ROTI 200GM',
If(Item = 'Milk Bread', 'MILK BREAD 300GM',
If(Item = 'BROWN (2PC) 50', 'BROWN (2PC) 50',
If(Item = 'HG 200E/2', 'HG 200E/2',
If(Item = 'HG LONG 250', 'HG LONG 250',
If(Item = 'BBUN 250', 'BBUN 250',
If(Item = 'SB (1PC) 80','SB (1PC) 80',
If(Item = 'Milk BREAD','MILK BREAD 300GM',
If(Item = 'READY ROTI','READY ROTI 200GM',
If(Item = 'MILK BREAD','MILK BREAD 300GM',
If(Item = 'Milk Bread 300gm','MILK BREAD 300GM',
If(Item = 'Ready Roti 200gm','READY ROTI 200GM',
Item)))))))))))) AS Item,
If(Target<0,0,Target) AS Target,
DROP TABLE tab3;
STORE tab4 INTO 'D:\Vivek\Data\Sale Target\Sale_Target_East_$(vStoreMonth).qvd'(qvd);