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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to write a variable into a set expressión

Hi,

I have this variable:

 

=Avg({1<MER_GRUPO={'A'},DIVISA={'EUR'},c_month={'Oct'},c_year={'2012'}>}I_TME

)

it works OK, but I need that 'Oct' and '2012' were variables too. 'año' is a variable too and I prooved with 

 

=Avg({1<MER_GRUPO={'A'},DIVISA={'EUR'},c_month={'Oct'},c_year={''&año&''}>}I_TME) and similar things but I wasn`t able to get the right results.

How can I do this?

Thanks

1 Solution

Accepted Solutions
whiteline
Master II
Master II

Hi.

Depending on what you've stored in a variable (YearVariable for example), you can try on of this:

=Avg({1<MER_GRUPO={'A'},DIVISA={'EUR'},c_month={'Oct'},c_year={'=$(YearVariable)'}>}I_TME)

=Avg({1<MER_GRUPO={'A'},DIVISA={'EUR'},c_month={'Oct'},c_year={'=$(=YearVariable)'}>}I_TME)

View solution in original post

3 Replies
whiteline
Master II
Master II

Hi.

Depending on what you've stored in a variable (YearVariable for example), you can try on of this:

=Avg({1<MER_GRUPO={'A'},DIVISA={'EUR'},c_month={'Oct'},c_year={'=$(YearVariable)'}>}I_TME)

=Avg({1<MER_GRUPO={'A'},DIVISA={'EUR'},c_month={'Oct'},c_year={'=$(=YearVariable)'}>}I_TME)

Anonymous
Not applicable
Author

In addition, assuming you need current year and current month, you don't need variables:


=Avg({1<MER_GRUPO={'A'},DIVISA={'EUR'},c_month={"$(=date(ReloadTime(), 'MMM'))"},c_year={"$(=year(ReloadTime()))"}>}I_TME)

Regards,
Michael

lmenendez_grupo_pinero
Contributor III
Contributor III

This question was made for me in 2012. 

How could I recover that user and my own bakground with it?