0

I am looking to add a weekly filter onto my Qlik dashboard to allow me to change the weekly data that is displayed on my dashboard. My original idea works well as I wanted to display the latest weeks data and compare this to the previous weeks and this gives me exactly what I want.

To enhance this and give the dashboard a bit more flexibility and just in case someone wanted to look at a different week, I thought it might be a good idea to add a weekly filter but the way I have built the dashboard won't allow me to do this. The following is an example of what I have:

In my database table I have a rank column (latest_week_rank) where the latest weekending (i.e. Mon 13th to Sun 19th Jan) has a value of 1 and the 2nd latest week would be 2 etc. I have then written the following code in my data tab:

latest_week                 =   1;
previous_week               =   2;

I have then written the following which is then called within a Multi KPI:

vOrdersWTD          =Sum({<latest_week_rank =  {$(latest_week)}>} total_orders)

This is obviously where the problem lies as having the weekly filter makes no difference as no other weeks show up but I am not sure how I change my code in order to make this all work.

I would really appreciate if somebody could advise on how I can change this around.

Michael Owen
  • 365
  • 3
  • 20

1 Answers1

0

Instead of assigning your predetermined variable in set analysis, use the actual field. Something like:

$(=
  'Sum({<latest_week_rank =  {'
& max(latest_week_rank)+1
& '}>} total_orders'
)
George Menoutis
  • 6,894
  • 3
  • 19
  • 43
  • Thanks George, I will give that a go and let you know how I get on. – Michael Owen Jan 24 '20 at 21:08
  • Hi George, I wrote the code in the Expression Field and got an OK for the formula but result shows up with no values, just going to break up the code to see if I can work out the issue. – Michael Owen Feb 03 '20 at 12:00