Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
jim_chan
Contributor III

how to write a MTD set analysis.

Hi guys,

i have a MTD set analysis as below:

Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num(MonthStart(Max(DateNum))))<=$(=Max(DateNum))"}>} Sales)


my scenario.

1) When i did not select anything - it does shows me the MTD sum sales.

2) But when i select a report_date selection: for exmaple the report_date is 22/10/2018. Then my MTD will turn to 0. 0 value.

So how can i have a MTD that when i select a report_date , it can still show the  sum sales of the report_date 22/10/2018 ?

Please help guys.

Rgds

Jim Chan

1 Solution

Accepted Solutions
andrey_krylov
Valued Contributor

Re: how to write a MTD set analysis.

Hi Jim. Try to add the report_date to set analysis

Sum({<Year=, Month=, Quarter=, Week=, DateField=, report_date=, DateNum={">=$(=Num(MonthStart(Max(DateNum))))<=$(=Max(DateNum))"}>} Sales)

View solution in original post

4 Replies
andrey_krylov
Valued Contributor

Re: how to write a MTD set analysis.

Hi Jim. Try to add the report_date to set analysis

Sum({<Year=, Month=, Quarter=, Week=, DateField=, report_date=, DateNum={">=$(=Num(MonthStart(Max(DateNum))))<=$(=Max(DateNum))"}>} Sales)

View solution in original post

ritesh_kodolikar
Contributor

Re: how to write a MTD set analysis.

Hi

Try this may work

Sum({<Year=,Month={">=$(=Floor(MonthStart(DateNum)))"}>}Sales)

Thanks

jim_chan
Contributor III

Re: how to write a MTD set analysis.

andrey,

if i have decided to put in the report_date= , does it ignore the report_date selection?

Rgds

Jim

andrey_krylov
Valued Contributor

Re: how to write a MTD set analysis.

Yes, report_date will be ignored.