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: 
karina89
Contributor III
Contributor III

Variables in an expression! HELP !!

Hello everyone!

I need to get the data from a previous day to my initial date, which have a variable (vFechaInicial).

The following expression runs but when I have a field (FechaInformacion):

Max ({<FechaInformación = { "<$ (= max (FechaInformación))"}>} FechaInformación)

But when I try to get my Variable I get error:

error.JPG

Anyone know where I'm wrong, or if I need to add something?

  I appreciate very much your help and your answers!

1 Solution

Accepted Solutions
bertinabel
Creator
Creator

If not achieve understand what you need.

already you tried the following?

= Date (vFechaInicial-1, 'DD / MM / YYYY')

in this case defined the vFechaInicial variable with the value 02/19/2016

- - -

No se si logre entender bien lo que necesitas.

ya intentaste lo siguiente?

=Date(vFechaInicial-1,'DD/MM/YYYY')

en este caso defini la variable vFechaInicial con el valor de 19/02/2016



Note: English translation provided by a Community Moderator as a courtesy. Please post in English while in main forums.

View solution in original post

6 Replies
sunny_talwar

What is your variable containing? If it is a field name, then regardless of any error, you should get expected output. But if it is an expression, this may or may not work.

Best,

Sunny

maksim_senin
Partner - Creator III
Partner - Creator III

Hi Karina,

It's hard to help without a sample. In case you expect to have different prev. dates for each row this will hardly work since (a.f.a.i.u.) set analysis applies to a chart in a whole and cannot vary its outcome from row to row.

Best regards,

Maxim

karina89
Contributor III
Contributor III
Author

Hello!!

What I want is to get the day before, to the day I have stored in my variable ( vFechaInicial )
That means if my variables have stored the following date: 19/02/2016 What I Get serious : 02/18/2016

I need an expression to help me get that result Using variables In it , I had thought to put so :
error.JPG

     But I make a mistake and I do not need to add or correct .

Or if anyone knows that otherwise could get what I want I would greatly appreciate your support

bertinabel
Creator
Creator

If not achieve understand what you need.

already you tried the following?

= Date (vFechaInicial-1, 'DD / MM / YYYY')

in this case defined the vFechaInicial variable with the value 02/19/2016

- - -

No se si logre entender bien lo que necesitas.

ya intentaste lo siguiente?

=Date(vFechaInicial-1,'DD/MM/YYYY')

en este caso defini la variable vFechaInicial con el valor de 19/02/2016



Note: English translation provided by a Community Moderator as a courtesy. Please post in English while in main forums.

karina89
Contributor III
Contributor III
Author

Thank you very much, if I run, just one more question.

If you would like to take the year or the month before my date, as might represent?

Muucho appreciate your help!

- - -

Muchas gracias, si me funciono , solo una pregunta mas.
Si quisiera tomar el año o el mes anterior a mi fecha, Como podría representarlo?


Agradezco muucho tu ayuda!

Note: English translation provided by a Community Moderator as a courtesy. Please post in English while in main forums.

bertinabel
Creator
Creator

Hi, Karina.

     For the previous month :

     =Date (Addmonths(vFechaInicial,-1), 'DD/MM/YYYY')

    

     For the previous year.

     =Date (AddYears(vFechaInicial,-1), 'DD/MM/YYYY')

    

Regards.