Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewforum
Creator II
Creator II

How to avoid using DocumentTitle() and use parameter in the sub-routine to execute the piece of code?

How can I avoid using the DocumentTitle() in the below sub-routine? I know we can pass the parameter in sub-routine but is it possible to pass the parameter to execute the piece of code? Please suggest!

SUB Calendar

[CALENDAR]:
LOAD
     Period as AsOfPeriod
Resident [Calendar];


if DocumentTitle()='XYZ' then

  Concatenate([CALENDAR])
  LOAD
   Period,
   'Dummy' as Check
  Resident [CALENDAR];

end if

END SUB

3 Replies
qlikviewforum
Creator II
Creator II
Author

Any update on this?

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Not sure if I've understood you correctly, but is this it?

SUB Calendar(zSuppress)

[CALENDAR]:

LOAD

     Period as AsOfPeriod

Resident [Calendar];

if zSuppress = 0 then

  Concatenate([CALENDAR])

  LOAD

   Period,

   'Dummy' as Check

  Resident [CALENDAR];

end if

END SUB

Then call it using CALL Calendar(0) or CALL Calendar(1)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
qlikviewforum
Creator II
Creator II
Author

Excellant Jonathan! Thank you

Can you give me one more example by passing the 2 or more parameters.