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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

how to set variable???

how to set variable in sheet of qlikview??

select projectedadjustment from qlk_projected where year1=[Fiscal Year] and month1=[Fiscal Month];

[Fiscal Month], [Fiscal Year] are two fields from table, which is also set as variable in qlikview sheet like:

set variable as:

[Fiscal Year]=[Fiscal Year];

[Fiscal Month]=[Fiscal Month];

6 Replies
swuehl
MVP
MVP

I am not sure about what you are trying to achieve. I you want to define variables in the script, you can use LET or SET script statement:

SET year1 = 2013;

SET month1 = 12;

select projectedadjustment

from qlk_projected

where $(year1) = [Fiscal Year] and $(month1) = [Fiscal Month];

If you want to define a variable in the frontend, you can use the variable overview (under Settings, or press CTRL-ALT-V).

suvechha_b
Creator III
Creator III
Author

Hi,

I want to create in variable overview...in one variable..

not in script...I dont want to fix

SET year1 = 2013;

SET month1 = 12;

this....all this be dynamic

How to write in variable overviw ??

how to set it in a variable in qlikview model???

CELAMBARASAN
Partner - Champion
Partner - Champion

May be you need this

Use

vYear = Max([Fiscal Year])

vMonth = Max([Fiscal Month])

but you trying to use it in load script?

suvechha_b
Creator III
Creator III
Author

no... I want to assign it in variable.......... such as: vData:

I like to get this query in my variable overview :

select projectedadjustment from qlk_projected where year1=[Fiscal Year] and month1=[Fiscal Month];

suvechha_b
Creator III
Creator III
Author

How to write this :

=Sum({$<year1={$(vYear)}>& 'and' & $<year1={$(vMonth)}>} projectedadjustment)

in settings>>Variable Overview:

Add a variable :vData and set the above statement...

suvechha_b
Creator III
Creator III
Author

How to write this :

=Sum({$<year1={$(vYear)}>& 'and' & $<year1={$(vMonth)}>} projectedadjustment)

in settings>>Variable Overview:

Add a variable :vData and set the above statement...