Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MTD date issue ?

HI All,

There is no relation between these tables, but in the all the tables Used [Invoice Date] ...

I have created top customers report they are working fine on Invoice date, but i have created MTD using YrRollMonth with the Varible as vMthDt in Gross Margin (MTD Logic)..

They are Separately working fine with their filters, but I need to use Invoice date & Year as Filters, Is this possible can any one help me...

AllInvoiceDate:

LOAD DISTINCT

  [Invoice Date],

  year([Invoice Date]) as [Invoice Year],

  month([Invoice Date]) as [Invoice Month]

RESIDENT Invoices;

Current_Rollmonth:

Load

MonthName([Invoice Date]) As YrRollMonth

Resident Invoices

Where Year([Invoice Date]) = Year('$(vMaxDt)');

MaxInvoiceDt:

Load

  max([Invoice Date]) As maxInvoiceDt

Resident Invoices;

Let vMaxDt = Date(Peek('maxInvoiceDt'));

Variable:   vMthDt= Date(YrRollMonth)

1 Reply
morgankejerhag
Partner - Creator III
Partner - Creator III

Hi,

I am not sure what you are trying to achieve. Is it a sum of month to date? In this case you can create a flag for each transaction or in a calendar (AllInvoiceDate in your example).

In the script:

if(InMonthToDate([Invoice Date].today(),0),1,0) as Flag_MTD

Then in your expression in the chart you can use:

sum({<Flag_MTD={1}>} Value)

If you want to have a MTD value for any date in the history you should look into AsOf-calendar functions.

Best regards,

Morgan Kejerhag

Senior Business Intelligence Consultant, Drake Analytics

http://www.drakeanalytics.se