Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Date Filter (Qlik Sense)

I need help with this issue I'm having.

First off all lets talk about my data

this are my formats

SET TimeFormat='hh:mm:ss TT';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff] TT';

I declare this variables

SET vAnioActual=YEAR(NOW());

SET vAnioAnt=YEAR(NOW())-1;

SET vMesActual=MONTH(Today());

SET vFechaHoy=Now();

SET vFechaAnioAtras = Date#(Now()-365,'DDMMYYYY');

When I bring my data this are my fields that brings date data

LOAD Documento,

    Fecha,

    Date#(Fecha,'DDMMYYYY') As FechaNum,

    YEAR(Fecha) As Anio,

    MONTH(Fecha) As Mes,

     TotalVta............

Where Fecha is my field containing dates in dd/mm/yyyy format

I've been trying to get info of my sales (TotalSales) From the last 12 months from now, I've been trying using, variables, a constant and formulas, but not working at all.    I Attached my App.   Please help

Thanks in advance

15 Replies
Not applicable
Author

2015-06-16 13.16.06.png

sunny_talwar

Try this:

Num(Date#(Fecha, 'DD/MM/YYYY hh:mm:ss TT')) as FechaNum,

Date(Date#(Fecha, 'DD/MM/YYYY hh:mm:ss TT')) as Fecha


and the expression would be:


=SUM({<Anio=, Mes=, Fecha = {"$(='>=' & Date(YearStart(Today())) & '<=' & Date(Today()))"}>} TotalVta)

Not applicable
Author

this is the result on the table

2015-06-16 13.20.59.png

And the graph have the lines for all years and month

sunny_talwar

What output you get when you put this in a text box object?

='>=' & Date(YearStart(Today())) & '<=' & Date(Today())

Not applicable
Author

Thank You very much, I'll fix it, I rewrite my stored procedure so it give me field fecha just as dd-mm-yyyy so when I did the thing you told me before it worked.

Thank you for your time and help

sunny_talwar

Great

I am glad it finally worked out for you.

Best,

Sunny