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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
AjithramT
Contributor II
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
Ivan_Bozov
Luminary
Luminary

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

vizmind.eu