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: 
berryandcherry6
Creator III
Creator III

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
Partner - Champion III
Partner - Champion III

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 III
Creator III
Author

Hi gwassenaar ,

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

Regards