Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
berryandcherry6
Creator II
Creator II

filter dates according to condition in Qliksense

HI,

i need to get latest 30 weeks data for graph, below is code used in script

LOAD

     Date(Date#(Date,'YYYYMMDD'),'DD-MM-YYYY') as [Format Date],

     Dual(Date(WeekStart(Date(Date#(Date,'YYYYMMDD'),'DD-MM-YYYY')),'DD/MM') & '-'

          & Date(WeekEnd(Date(Date#(Date,'YYYYMMDD'),'DD-MM-YYYY')),'DD/MM'), WeekStart(Date(Date#(Date,'YYYYMMDD'),'DD-MM-YYYY'))) as Week,

    Hits;

SQL SELECT

    Date,

    Hits

FROM ViewTrafficTable;


For Graph, Dimension: Week

                 Expression: Sum(Hits)

How could i modify my expression, so i get only latest 30 weeks in graph.

I tried setting Fixed number = 30, in limitation. Yes it shows 30 weeks data, but not latest.

2 Replies
Gysbert_Wassenaar

Perhaps like this:

Sum({<Week={">$(=Date(max(Week),'DD-MM-YYYY')-210)<=$(=Date(max(Week),'DD-MM-YYYY')"}>}Hits)


talk is cheap, supply exceeds demand
berryandcherry6
Creator II
Creator II
Author

Hi gwassenaar ,

No, this is not working. i get values only (Dimension)x axis, no data shown for measure(y-axis)

Regards