Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to query the expression statistics data

Hey guys,

I'm Chinese,English so poorly,I hope someone can know my question

The form have a input box (we can input two nums),and have a btn,we can use btn search the data from chart,and data is expression statistics .the expression is

if(rzxxcs <> '' and rzsxcs <> '',
if(Count (??ID) >= rzxxcs and count(??ID)<= rzsxcs,count(??ID)),
if(rzxxcs = '' and rzsxcs <> '',
if(count(??ID)<= rzsxcs,count(??ID)),
if(rzsxcs = '' and rzxxcs <> '',
if(Count (??ID) >= rzxxcs ,count(??ID)),
count(??ID)
)
)
)


How do it use vb script actions?

My plan:

1.define fourvariables : NUM_SX,NUM_XX,rzxxcs,rzsxcs

2.define the variables NUM_SX,NUM_XX to Input boxs

3.vb script action

' Create By KanGwei in 2010/10/26

' get the value of variable

function getVarValue(p_varname)
getVarValue=activeDocument.variables(p_varname).getContent.string
end function

' set the value to variable

sub setVarValue(p_varname,p_varvalue)
dim d_var
Set d_var=ActiveDocument.Variables(p_varname)
d_var.setContent p_varvalue,true
end sub

' Search action

sub s_dosearch

dim d_sx,d_xx

d_sx = getVarValue("NUM_SX")
d_xx = getVarValue("NUM_XX")

' ???? ?? ???? Error info
if d_sx < d_xx then
msgbox "????????????"
' All Passed?Do Search
elseif d_sx >= d_xx then
call setVarValue("rzxxcs" ,d_xx)
call setVarValue("rzsxcs" ,d_sx)
end if

end sub

Now ,I have two problems:

1.Do you have another method do it?(I hope you can give me a QVW)

2.After search,How to clear the variable in the expression ?

Thanks!!!

My Msn:willking6517@live.cn

Labels (1)
3 Replies
Not applicable
Author

No body can answer me[:'(]

Not applicable
Author

No body can answer me[:'(]

pablolabbe
Partner Ambassador
Partner Ambassador

Why you need variables to define search criteria ? Can you explain the purpose of the expression ?

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button! | Follow me on Linkedin