Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
m4u
Partner - Creator II
Partner - Creator II

VB functions in qlikview

Hi all,

it is possible to use a user function i wrote in vb, as an expression in qlikview, for example this function

i would like to use it in the sort expression of a pivot.


Function StageOrder(StageID As Integer) As Integer

Dim Value As Integer
Select Case StageID
Case 1
Value = 1
Case 9
Value = 2
Case 10
Value = 3
Case 11
Value = 4
Case 2
Value = 5
Case 3
Value = 6
Case 4
Value = 7
Case 5
Value = 8
Case 6
Value = 9
Case 7
Value = 10
Case 8
Value = 11



End Select

StageOrder = Value
End Function

thanks,

shlomo

1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

No, you cannot call Vb user functions from a chart expression. You can call them from script.

You can provide similar function in several ways.

1. Sort by expression and use a match expression:

=match(StageID, 1,9,10,11,2,3,4,5,6,7,8)

2. Load an inline table with
StageID, StageSort

And then use =StageSort as your sort expression.

-Rob