8 Replies Latest reply: Nov 15, 2016 7:22 AM by Dirk Fischer RSS

    Problem with set analysis and variables for between test

    Dirk Fischer

      Hi everybody,


      I pretty new to QlikSense and struggling with a set analysis problem, which is probably pretty easy to solve. But reading the discussion in the community didn't help, I'm just squashing my head on the wall.


      I have a graph, where I show the weekly production output for a Job since the start of the Job. If a week on the graph is selected, I show the output for the job up to this week. This is working fine.


      Now I want to show the daily output for the selected week or if nothing is selected, Show the daily output for the latest week.


      If I use the formula like below, everything is working fine.


      Sum({$<DATE_NO={">=42275 <=42281"}>} GROSS_QTY)


      DATE_NO is an integer value for the production days and I filled up the missing days, so I have continuous datapoints for the whole Job.


      Now if I try to use variables, it looks like the selection is ignored, although the variables contain the correct values.(displaying them in the same table proves the fact). I have a variable vMaxDate, which stores the biggest selected date or the Overall Maximum, if no week is selected. From this variable, I calculate the 1st day of the week, with $(vMaxDate) - WeekDay(vMaxDate, 0), for the last day I add 6 to the 1st day of the week. Using the variables in a table displays the correct values and if I use the fixed expression, the table is reduced to 3 rows, as expected. If I use a variable expression, I get all rows in the table displayed.


      I tried


      Sum({$<DATE_NO={">=$(v1stDaySelectedWeek) <=$(vLastDaySelectedWeek)"}>} GROSS_QTY)


      as well as


      Sum({$<DATE_NO={'>=$(v1stDaySelectedWeek) <=$(vLastDaySelectedWeek)'}>} GROSS_QTY)


      and all other kinds of Variation I found a proposed solution in other discussions.


      I also  tried the set analysis wizard from Stephan Walter, but it did not work for me.


      Does anybody see, what's wrong?


      I would really appreciate, if somebody has a proposal, because I start getting bored from the squishy sound of my head banging on this wall.