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);

Wednesday, October 2, 2013

It is possible to recover the Document CAL License?

Scenario:
 User deleted the QlikView Document, for which the licenses were allocated. and also "Actually we forgot the Document Name"

Solution:
1)Stop the QlikView Server service.
2)Add PgoAsXmlAlso=1 under [Settings 7] in the Settings.ini file located in %ProgramData%\QlikTech\QlikViewServer (default location)
3)Restart the QlikView Server service
4)Navigate to Root Directory and Open the CalData.pgo.xml file to determine to which document the
CALs were assigned
5) Create a new blank QVW file named the same as document listed in CalData.pgo.xml & save it in
the Root directory
6) In Management Console, navigate to Documents > User Documents and locate QWV created in the
previous step
7) Click Document CALs tab and set Number of CALs allocated to this Document to zero and click
Apply


--
Thanks to QlikView Community posts
 

Thursday, August 22, 2013

Load variable from text file

QV - Community Posts:
http://community.qlikview.com/thread/89947

Method 1:
 Load the Text file into QlikView & use Peek function to populate the Variable.

Variable_Table:
LOAD @1
FROM
Variable_Txt.txt
(txt, codepage is 1252, explicit labels, delimiter is '\t', msq);

LET X=NUM(Peek('@1',0,'Variable_Table'));

Method 2:
Use Include Statement , to get the variable - if the text in file can be made as LET STATEMENT.

write "LET vPQLow = 54;"

And then INCLUDE this into the QV Script:

$(Include=C:\Path\vPQLow.txt);

Forecast and Backcast - In Charts

From QV-Community Posts:

Expression tab:

TrendlinesIn selected QlikView charts expression plots can be complemented or replaced by statistical trend lines. Trend lines can only be displayed in scatter charts, line charts and in bar/combo charts with maximally one dimension and one expression shown as bars. For other types of charts, the settings in the Trendlines group are unavailable and have no effect. In scatter charts the data points are treated as if y=f(x). For bar, line and combo charts it is allowed to deselect all options under Display Options and still add trend lines, which will then be plotted without the underlying data points. Trend lines in bar, line and combo charts may be extrapolated by specifying a forecast and/or backcast interval (Axes page). The extrapolated lines will be dotted. Trend lines in charts with a discrete x-axis will be shown as lines with symbols. On a continuous axis only the line will be shown.

Average
The average is plotted as a straight line. 
Linear
A linear regression line is plotted. 
Polynomial of 2nd degree
A polynomial trend line of the second degree is plotted. 
Polynomial of 3rd degree
A polynomial trend line of the third degree is plotted. 
Polynomial of 4th degree
A polynomial trend line of the fourth degree is plotted. 
Exponential
An exponential trend line is plotted. 
Show Equation
If this check box is marked for a specific expression, the expression’s trend lines will be complemented by the trendline equation expressed as text in the chart. 
Show R2
If this check box is marked for a specific expression, the expression’s trend lines will be complemented by the coefficient of determination expressed as text in the chart.

Axis tab:

Backcast
This function operates on trend lines. Enter into the text edit box how far back you would like to estimate the trend line. See Chart Properties: Expressions. The backcast portion of trend lines is displayed as dotted.
Forecast
Enter into the text edit box how far you wish to predict the trend line. See Chart Properties: Expressions. The forecast portion of trend lines is displayed as dotted.

So try creating a simple line chart (best with numerical axis), add any trendline (start maybe with a simple one, linerar, and play around with the options in axis tab).

QV - 1stStep


A simple way to say that here it starts the first step towards the QV Blogging by the Achiever.