Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
AjithramT
New Contributor II

ytd qtd mtd

Hi,

I needs to show the ytd,qtd,mtd for the current year in the single kpi as per the selection. I wrote the following in the kpi. But it didn't work. Can anyone share your idea..And i needs to show the prev year also..  

$(=if(YTD_QTD_MTD='YTD', Count({<OrderDate={"$(='>=' & Date(YearStart(Max(OrderDate)),'DD-MM-YYYY') &'<=' & date(max(OrderDate),'DD-MM-YYYY') &)"}>}OrderID),
if(YTD_QTD_MTD='MTD', Count({<OrderDate={"$(='>=' & Date(MonthsStart(Max(OrderDate)),'DD-MM-YYYY') &'<=' & date(max(OrderDate),'DD-MM-YYYY') &)"}>}OrderID),
if(YTD_QTD_MTD='MTD', Count({<OrderDate={"$(='>=' & Date(QuarterStart(Max(OrderDate)),'DD-MM-YYYY') &'<=' & date(max(OrderDate),'DD-MM-YYYY') &)"}>}OrderID) ))))

Thanks,

Ajith

 

1 Reply
Luminary
Luminary

Re: ytd qtd mtd

So you want the KPI to reflect a selection made in a filter pane for example? You can use 

 

IF(GetFieldSelections(YTD_QTD_MTD)='YTD',... 

 

 For the measures you can check these links:

https://help.qlik.com/en-US/sense/November2018/Subsystems/Hub/Content/Sense_Hub/Measures/create-cale...
https://www.youtube.com/watch?v=8KH5ebXD4TU