Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Not applicable

Last 4 week data

Hi All,

I am building a dashboard which represents data in chart for last 4 week. I have ListBoxes of Year, Month, Day.

When I select a only day it shows correct result.Ex. 03rd Dec. but when I select specific month ( like Dec), it shows data till 01st of Dec only. Again when I clear Month filter data shows correct.

For calculating I have used following set analysis.

Week1: SUM({$<[Report Day] = {">=$(=Date(Max([Report Day])-6))<=$(=Date(Max([Report Day])))"}>}[Chat Request])

Week2: =SUM({$<[Report Day] = {">=$(=Date(Max([Report Day])-14))<=$(=Date(Max([Report Day]-7)))"}>}[Chat Request])

Week3: =SUM({$<[Report Day] = {">=$(=Date(Max([Report Day])-21))<=$(=Date(Max([Report Day]-15)))"}>}[Chat Request])

Week4: =SUM({$<[Report Day] = {">=$(=Date(Max([Report Day])-27))<=$(=Date(Max([Report Day]-22)))"}>}[Chat Request])

Please help me on this..

6 Replies
Highlighted
MVP
MVP

Re: Last 4 week data

Provide source data or sample application..

Highlighted

Re: Last 4 week data

May be you need to ignore selection in Month field?

Week1: =Sum({$<[Report Day] = {">=$(=Date(Max([Report Day])-6))<=$(=Date(Max([Report Day])))"}, Month>}[Chat Request])

Week2: =Sum({$<[Report Day] = {">=$(=Date(Max([Report Day])-14))<=$(=Date(Max([Report Day]-7)))"}, Month>}[Chat Request])

Week3: =Sum({$<[Report Day] = {">=$(=Date(Max([Report Day])-21))<=$(=Date(Max([Report Day]-15)))"}, Month>}[Chat Request])

Week4: =Sum({$<[Report Day] = {">=$(=Date(Max([Report Day])-27))<=$(=Date(Max([Report Day]-22)))"}, Month>}[Chat Request])

Highlighted
New Contributor III

Re: Last 4 week data

Hi,

As per my understanding, you are selecting both date and month. Is it right?  and you want to have data from 3rd dec to 6th November even when you selected Month. Please confirm if I'm right.

Highlighted
Not applicable

Re: Last 4 week data

Hi Sunny,

Right now we are ignoring the month field. So it generates correct result. But user friendly perspective, we cant tell others to clear month if you wish to see weekly trend.

Hi Vishwa,

Yes, you are correct.

Highlighted
Not applicable

Re: Last 4 week data

Hi Sunny,

Sorry. I did not see your comment in detailed. its actual answer.

Thanks dude

Highlighted

Re: Last 4 week data

That's not what I meant... Not asking users to not select it... but ignore there selection in your expression. Have you tried the expressions I gave above?

Week1: =Sum({$<[Report Day] = {">=$(=Date(Max([Report Day])-6))<=$(=Date(Max([Report Day])))"}, Month>}[Chat Request])

Week2: =Sum({$<[Report Day] = {">=$(=Date(Max([Report Day])-14))<=$(=Date(Max([Report Day]-7)))"}, Month>}[Chat Request])

Week3: =Sum({$<[Report Day] = {">=$(=Date(Max([Report Day])-21))<=$(=Date(Max([Report Day]-15)))"}, Month>}[Chat Request])

Week4: =Sum({$<[Report Day] = {">=$(=Date(Max([Report Day])-27))<=$(=Date(Max([Report Day]-22)))"}, Month>}[Chat Request])