Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Adding a Variable in Script

Hey!

I have the following script:

Offset_in_Hub=0.1


Verteilung_Verschoben:
Crosstable (Linie_niO_Verschoben, Wert_niO_Verschoben, 1)
LOAD Datum,
     L_Z1V1,
     L_Z1V2,
     L_Z2V1,
     L_Z2V2,
     L_Z3V1,
     L_Z3V2,
     L_Z4V1,
     L_Z4V2,
     L_Z1V1+Offset_in_Hub,
     L_Z1V2+Offset_in_Hub,
     L_Z2V1+Offset_in_Hub,
     L_Z2V2+Offset_in_Hub,
     L_Z3V1+Offset_in_Hub,
     L_Z3V2+Offset_in_Hub,
     L_Z4V1+Offset_in_Hub,
     L_Z4V2+Offset_in_Hub
    
FROM
[aktuell_SPC_Daten.xlsx]
(ooxml, embedded labels, table is Iprozer);

The thing is that Qlikview doesn't understand that "Offset_in_Hub" is a Variable that I just defined. It works when I write a constant (like 0.1) instead of my variable, but this Offset must be variable with a Inputbox.

Thank you very much!!!

Eduardo

Tags (2)
1 Solution

Accepted Solutions
Not applicable

Re: Adding a Variable in Script

Finally I put the offset in the dimension and it worked as I wanted!

Eduardo

5 Replies
jsn
Honored Contributor

Re: Adding a Variable in Script

Try:

SET Offset_in_Hub=0.1;

jsn
Honored Contributor

Re: Adding a Variable in Script

And call it using $(Offset_in_Hub)

Not applicable

Re: Adding a Variable in Script

Thank you vey much Johannes! It works perfectly. But I just realized that even if I change the value of "Offset_in_Hub" with an Inputbox, my data doesnt change till I run the skript again.

What I plot the following chart with these datas:

Dimension: =Class(Wert_niO_Verschoben, 0.001)

Expression: =Count(Wert_niO_Verschoben)

Can you please help me??

Thank you!!

Eduardo

Not applicable

Re: Adding a Variable in Script

Thank you for your help but it doesnt work...

What I plot are Gauss bells. For every L_ZXVY I plot a Gauss bell. I would like to plot these sames Gauss bells but with a offset that I can change with an Inputbox (and without running the script again...).

Do you have any idea??

Thank you for your time and effort!

Eduardo

Not applicable

Re: Adding a Variable in Script

Finally I put the offset in the dimension and it worked as I wanted!

Eduardo