Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

fmazzarelli
Contributor III

variable

hi Community,

I wanted to thank you for the support you have given me .


Not being a programmer but a user , I need someone to take care about my needs .


I need to create a variable where to insert a date ( eg 06.20.2015 ) and based on a range of dates specified by the user ( ie from 01/01/2010 to 07/30/2015) I should go

to rapresent


since date 01/01/2010 to 20/06/2015 indicating the data as expired

since 06.20.2015 to 07.30.2015 indicating the data as to expire.


Could you help me?


23 Replies
datanibbler
Esteemed Contributor

Re: variable

Hi Fabio,

well, you will need two Input_Boxes where the user can enter dates - a start_date and an end_date. For ease of use, just use calendar_objects - then the user can easily select the dates and you can be sure about the format.

But - can you trigger the script to reload from the GUI? That is a prerequisite to be able to run it with parameters that you enter into input_boxes.

HTH

fmazzarelli
Contributor III

Re: variable

hi,

i use already calendar function and also an extension found on the site Qlik branch about the use of variables (see below).

But I need to use a variable inserted by the user and not read from the table.


Always on the site exists an extension to reload the data .


I have everything but I can not solve my needImmagine.pngImmagine.png

ogster1974
Honored Contributor II

Re: variable

To use that kind of functionality you would need to be using QlikView not Qlik Sense.

Sense doesn't currently support input boxes out of the box.

There is an extension for this here but I've not used it yet.

qsVariable

You would need to install this on your version of Sense to get this working.

fmazzarelli
Contributor III

Re: variable

hi,

I am very fast and I have already prepared the environment to test your suggestions

Immagine.png

ogster1974
Honored Contributor II

Re: variable

Good luck let us know how you get on.

Please mark any responses as being helpful or correct.

Regards

Andy

fmazzarelli
Contributor III

Re: variable

You can not leave me like this () . Give me a hint on how to do
ogster1974
Honored Contributor II

Re: variable

If you look in the comments under the extension a user has created a sample app in Qlik Sense using this control.

Switch Measures.qvf

Its using the button method rather than the input box but the principle should be the same.  Setting a value in a variable and using it in a chart.

Also note there is no validation check on the input box yet.

Regards

Andy

fmazzarelli
Contributor III

Re: variable

yes , I have downloaded it

but the starting point is that the variable is declared in the script .


I should do the opposite .


if I could create a temp table from the front end so that I coul use the value of the field in another table.

But howto?




ogster1974
Honored Contributor II

Re: variable

Why cant you set a default value in the variable? e.g.

SET vStartDate=01/01/1900

SET vEndDate=Today()

Remember

1. the control you are using has no validation check show showing the user an example of the value they need to enter is not a bad thing

2.  By setting a default position outside the date parameters of your chart data by default you will display something for your users and they can filter it down form there.