Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Partner
Partner

Trying to compare two kpi's; switch between ytd, qtd, mtd and wtd

YTD,QTD,MTD,WTD IN Qlik Sense

I have the same problem in sense. I am trying to compare two kpi's. I'd like to switch between ytd, qtd, mtd and wtd. I was very happy when i found this piece of code, but i still wasn't able to fix the problem in my app. So let's pretend i want to have mtd.

Sum({<Year,Quarter,Month,Week, OrderDate = {"$(='>=' & Date(MonthStart(Max(OrderDate)), 'YourDateFieldFormatHere') & '<=' & Date(Max(OrderDate), 'YourDateFieldFormatHere'))"}>} Sales)

  • I switched OrderDate to Datum because that is the date i am refering to
  • What means 'YourDateFieldFormat'? After OrderDate = there is no syntax highlightnig, i have no idea.
1 Solution

Accepted Solutions
Master III
Master III

cehck your Datum format

If(DateTemp1 = 'YTD', Sum({<type={'Order'},Year,Quarter,Month,Week, Datum = {"$(='>=' & Date(YearStart(Max(Datum ),-1), 'DD/MM/YYYY') & '<=' & Date(Max(Datum )-1, 'DD/MM/YYYY'))"}>} Sales)


YourDateFieldFormat means 'DD/MM/YYYY'


check the Datum format in filter

View solution in original post

1 Reply
Master III
Master III

cehck your Datum format

If(DateTemp1 = 'YTD', Sum({<type={'Order'},Year,Quarter,Month,Week, Datum = {"$(='>=' & Date(YearStart(Max(Datum ),-1), 'DD/MM/YYYY') & '<=' & Date(Max(Datum )-1, 'DD/MM/YYYY'))"}>} Sales)


YourDateFieldFormat means 'DD/MM/YYYY'


check the Datum format in filter

View solution in original post