Thursday, December 26, 2013

QlikView - Replacing NULL with Dummy Values

Below QlikView Edit Script will help to Replace NULL values with Dumy Values ::

MissingMap:
MAPPING LOAD
null(), 'Others!' AutoGenerate 1;

MAP [Business Line] USING MissingMap;
MAP Product_Family_Desc USING MissingMap;
MAP Cell USING MissingMap;
MAP Group USING MissingMap;
MAP Line USING MissingMap;

Material_Order_Master2:
NoConcatenate   // This is important! We want a new table!
LOAD * RESIDENT Material_Order_Master;
DROP TABLE Material_Order_Master;  // Drop the original table

Tuesday, December 10, 2013

QV - Firewall - Exception & Port Details

Below Cmd line codes helps to create FireWall exception for the QlikView Server.

netsh advfirewall firewall add rule name="QV Accespoint HTTP" dir=in profile=any action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name="QV Accespoint HTTPS" dir=in profile=any action=allow protocol=TCP localport=443
netsh advfirewall firewall add rule name="QV Access for Comand Center" dir=in profile=any action=allow protocol=TCP localport=4710
netsh advfirewall firewall add rule name="QV Access for Directory Service Connector" dir=in profile=any action=allow protocol=TCP localport=4730
netsh advfirewall firewall add rule name="QV Access for Distribution Service" dir=in profile=any action=allow protocol=TCP localport=4720
netsh advfirewall firewall add rule name="QV Access for QMC / QEMC" dir=in profile=any action=allow protocol=TCP localport=4780
netsh advfirewall firewall add rule name="QV Access for QV client / QlikOCX" dir=in profile=any action=allow protocol=TCP localport=4747
netsh advfirewall firewall add rule name="QV Access for WebServer" dir=in profile=any action=allow protocol=TCP localport=4750
netsh advfirewall firewall add rule name="QV Access Server Tunnel" dir=in profile=any action=allow protocol=TCP localport=4774
netsh advfirewall firewall add rule name="QV LDAP port" dir=in profile=any action=allow protocol=TCP localport=389

netsh advfirewall firewall add rule name="QV LDAP port over SSL" dir=in profile=any action=allow protocol=TCP localport=636

Tuesday, December 3, 2013

QV - Master Calendar Scripts !!!

Master Calendar Scripts All Time :)

Quarter_Map:
Mapping
LOAD * INLINE [
    Month, Quarter
    Jan, Q4
    Feb, Q4
    Mar, Q4
    Apr, Q1
    May, Q1
    Jun, Q1
    Jul, Q2
    Aug, Q2
    Sep, Q2
    Oct, Q3
    Nov, Q3
    Dec, Q3
]
;

///////////////////////////////////////

SET vDateMin = Num(date('01/01/1950','DD/MM/YYYY'));
SET vDateMax = Num(date('31/12/2050','DD/MM/YYYY'));
LET vDateToday = Num(Today()); 
 


//LET vDateMin = Num(Peek('Open_DateTime', 0, 'Interval_Table'));
//LET vDateMax = Num(Peek('Close_DateTime', -1, 'Interval_Table'));
//LET vDateToday = Num(Today()); 

TempCalendar1: 
LOAD
$(vDateMin) + RowNo() - 1 AS Date_Key
Date($(vDateMin) + RowNo() - 1) AS Date 
AUTOGENERATE
WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);

Master_Calendar:
load Date_Key
       ,
Date
       ,
Date as CalendarDate
       ,
Day(Date) as CalendarDay
       ,
Week(Date) as CalendarWeek
       ,
WeekName(Date) as CalendarWeekName
       ,
month(Date) as CalendarMonth
       ,
MonthName(Date) as CalendarMonthName
       ,
MonthName(Date) as CalendarPeriod
       ,
Quartername(Date) as CalendarQuarterName
       ,
ApplyMap('Quarter_Map',num#(month(Date)))as CalendarQuarter 
       ,
year(Date) as CalendarYear
       ,
WeekDay(Date) as CalendarWeekDay
       ,
text(weekday(Date)) as Week_Day1

       ,WeekDay(Date) as CalWeekDay
       ,Week(Date) as CalWeek
       ,week(Date+3) as CalRWeek    
       ,WeekName(Date) as CalWeekName
       ,WeekName(Date,1,4) as CalWeekRName    //4=Fri     // Friday - Thursday Business Week
       ,MakeWeekDate(Year(Date),Week(Date)) as CalWkSD       
       ,num(MakeWeekDate(Year(Date),Week(Date))) as CalWkSDNum            
       ,MakeWeekDate(Year(Date+3),Week(Date+3),-3) as CalWkRSD      
       ,num(MakeWeekDate(Year(Date+3),Week(Date+3),-3)) as CalWkRSDNum  


Resident TempCalendar1;
DROP Table TempCalendar1;


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Thx for the QlikCommunity Post : by Jagan Mohan 
https://community.qlik.com/docs/DOC-9146
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
"Master Calendar with every 30 Minutes"

LET vMinDate = Num(MakeDate(2014,1,1));  // Calendar Start Date
LET vMaxDate = Num(Today()); // Calendar End Date
LET vDays = vMaxDate - vMinDate + 2;  // Calculating number of days between Start & End Dates

Calendar:
LOAD Date(Floor(TimeStamp)) AS Date,
TimeStamp,
Hour(TimeStamp) AS Hour,
Minute(TimeStamp) AS Minute;
LOAD
    Timestamp($(vMinDate) + (RecNo() - 1)/48) as TimeStamp

AUTOGENERATE 48 * $(vDays);