Wednesday 21 September 2011

QlikView : Macro function for Activate Sheet


if fxV(i).Text="CitizenMedAssurance"  then
     ActiveDocument.Sheets("sheet id").Activate
End if

QlikView : Macro function for Get All Sheet ID

sub LoopSheet
        for i = 0 to ActiveDocument.NoOfSheets - 1
           set ss= ActiveDocument.GetSheet(i)
           msgbox(ss.GetProperties.SheetId)
       next
end sub

QlikView : Macro Function for Get Selected ListBox Value

this macro will help you for get selected list box values. the selected values may be single or multiple.

Single:
SUB GetSelectedValues
     SET fx = ActiveDocument.Fields("UA_NewGroup")
     SET fxV = fx.GetSelectedValues   
       if fxV.Count=1 then                  
            msgbox(fxV(i).Text)       
       end if              
END SUB

Multiple:
SUB GetSelectedValues
     SET fx = ActiveDocument.Fields("UA_NewGroup")
     SET fxV = fx.GetSelectedValues

     FOR i = 0 TO fxV.Count -1                           
            msgbox(fxV(i).Text)                      
     NEXT
END SUB

Monday 19 September 2011

QlikView - Hide Sheet depends upon the Logon Users

By this technique we can hide sheets are control depends upon the log on users.

Goto Sheet Properties Under Show Sheet Group box Click Conditional Check box and enter this condition

Single User:
QvUser() = 'HARUN.RASEED'

Multiple User:
QvUser() = 'HARUN.RASEED' or QvUser() = 'GOWRISH'

Saturday 17 September 2011

QlikView : Auto Reload When Open the Document

The following steps used to Auto Reload When Open the Document in QlikView
Step 1: Create Macro name
Tools->edit module->create Macro like this

Sub AutoReload
    activeDocument.Reload
End Sub

Step 2:
go to menu , document properties > Triggers > OnOpen >> Add Action > External > Run Macro , use previous macro name(AutoReload).

QlikView : Count Function & Number Format

Syntax:
=num(COUNT(field name), '#,###,###,#00')


Example
=num(COUNT(JA_NATIONALID), '#,###,###,#00')

QlikView : Avoid NULL Value in Listbox

Add this function in ListBox Property function box,
Syntax:
=if(isnull(field name),'N/A',value or field name)

Example
=if(isnull(JA_LOCATION),'N/A',JA_LOCATION)