Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
veeranj
Creator II
Creator II

YTD usage ?

Hi All ,

I have the below data .

 

CUSTIDGROUPDATE(DD/MM/YYYY)
C1G101/01/2017
C2G201/01/2018
C3G101/10/2017
C4G201/10/2018

In one of the chart ,i have to show bydefault YTD values .We are in 2018 ,so bydefault it will display from Jan-01-2018 to till date .

My metric is that : To count number of customers from YearToDate .

I created a variable like VYTD=Yearstart(MAx(date)) and VmaxDate=MAx(date).

Expression being : Count({<Date >=$(VYTD)<=$(VmaxDate)>} CUSTID ) .

Here i have Group as my Filter .

If i select Group=G1 ,then VYTD will be 01/01/2017 and VmaxDate=01/10/2017 .


So is it like do i have to ignore the Group selections while calculating the Variables here  .


If i am having all required  groups in all the years ,then there shouldn't be a problem i guess.?


While calculating the YTD variables, do we generally ignore all the filter selections  which we use in reports / Frontend?


Need some help on this  .

Thanks,

Anjee


1 Reply
Anonymous
Not applicable

try the following :

Count({$<Date >=$(VYTD)<=$(VmaxDate)>} CUSTID )


or


Count({1<Date >=$(VYTD)<=$(VmaxDate)>} CUSTID )

or


aggr(Count({<Date >=$(VYTD)<=$(VmaxDate)>} CUSTID ) ,GROUP)