Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vrb
Contributor II
Contributor II

Need help on date calculation

WHERE month IN (convert(varchar(8),dateadd(dd,7-datepart(dw,getdate())-5,getdate()),112)

,convert(varchar(8),dateadd(dd,-7,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-14,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-21,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-28,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-35,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-42,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-49,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-56,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-63,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-70,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

,convert(varchar(8),dateadd(dd,-77,dateadd(dd,7-datepart(dw,getdate())-5,getdate())),112)

)

I found the above query is used in stored procedure to calculate dates. how can i bring the same functionality in qlikview chart.

ex. In a list box there are 12 monday dates from recent monday are shown for user to select. if the user select any monday date, there is two more dates should shown in the chart. if user select first monday of this month the chart should show values of the selected monday values, then previous month first monday values and previous to previous month first monday values. similarly if they select anyother monday date the other two months monday should show the values. Please help me to achieve the same.

0 Replies