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

Set Anaysis Date Variable

I have this variable to allow the user to modify

Variable.JPG

I want to calculate with set analysis, sales from that date until today.

Easy no???

-sum({<"Posting Date" ={">=$(vFecha)"} Venta)

Maybe it's because of the format


Dosen't work

Please help



1 Reply
erichshiino
Partner - Master
Partner - Master

Hi,

Did you try to use this expression instead:

sum({<[Posting Date] ={">=$(vFecha)"} Venta)

There maybe another issue:

It's possible to make it work if you can guarantee that you can compare dates on the same format.

I suggest the use of fields and variables as numbers (as they are actually stored both on QV and Excel).

First, you need to create a field that you are sure will be only on a integer forma.t

So at the script level, where you create Posting Date create another one using num()

LOAD [Posting Date],

num ( [Posting Date] ) as nPostingDate,

other fields, etc

from ... // you regular script

Change your variable to

=num(today() -120)

Your final expression will be:

sum({<[Posting Date] ={'>=$(vFecha)'} Venta)

or

sum({<[Posting Date] ={'>=$(=vFecha)'} Venta)

Hope it helps,

Erich