Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

qsVariable Extension

Hi,

I was looking for the possibility to select only one dimension for every chart on my analysis. I found that this is possible with qsVariable Extension.

I've got simple question as I'm totally new to Qlik. I don't now how to start, I just want to have the possibilty to select only one year which would be a base year for comparison (I compare a year to year data). I don't know how can I define a variable so that it would show me the list of years from which I would select only one.

Thanks for your help,

Maciek

23 Replies
rohitk1609
Master
Master

Thanks Sharddha for your Input. The same has been highlighted in attached snapshot

Anonymous
Not applicable
Author

Yes, I understand. Let's say that I have a variable named varYear. It gives current year as a result. But If I put it into the highlighted place It doesn't work. I put it like that =varYear. Maybe I should write it in a different way.

rohitk1609
Master
Master

Hi maciej,

Use it as $(varYear) ,it will work . This is how you may use a variable or technically we call it , expansion of variable and we use dollar sign for it.

Anonymous
Not applicable
Author

No matter how I write it, it doesn't work. It only works fine if I put there a static value. Maybe there is a different obstacle on my side which I can't see. You can see how I used it in the screen (Rok in Polish means Year).

In the box below, where there is a visible value 2016 there is used the same varRok (for test) variable and it works (but this is a standard text box from Qlik).

varYear.png

rohitk1609
Master
Master

Hi Maciej,

Can you share the sample qvf so I can add my inputs to it. It will save your time and efforts ?

Anonymous
Not applicable
Author

I'm attaching a sample qvf file which has got your extension used.

Maciej

rohitk1609
Master
Master

Hi Maciej,

Can I see how you are creating your variable ?

Anonymous
Not applicable
Author

Yes, variable varRok is definied in a Data Load Editor. On test purpose I made it the simplest I can, so that I'm sure there is no mistake as

SET varRok=2016;

But the final version should be definied as Year(max(DataDok)) where DataDok is date.

Maciej

rohitk1609
Master
Master

Hi Maciej,

Perform a QA once as , Drag a KPI on your sheet , then add $(varRok) and see what value is coming. If the value is not coming as you want , then check how you are creating your variable.

Read once this :

The Magic of Variables

This will clear your concept about variables.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Rohit Kumar

rohitk1609
Master
Master

Please do