Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

berryandcherry6
Contributor 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.

Tags (2)
2 Replies

Re: filter dates according to condition in Qliksense

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
Contributor II

Re: filter dates according to condition in Qliksense

Hi gwassenaar ,

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

Regards