Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlik Community,
I have a measure, '% duly completed', which is as follows in set analysis
num(
count(
{<[Deliverable Status]={'Completed','Approved'},
[Deliverable Due to Date] = {1}>}
[Deliverable _Key])
/
sum ({<[Deliverable Status]-={'Waived'},
[Deliverable Due to Date] = {1}>} [Deliverable Due to Date])
Now I want to add an additional condition in this measure to filter the data as per YTD which displays results from Jan 2021 to current. So the new code is:
num(
count(
{<
Date=,Year=,Month=,Quarter=,today()={">=$(=YearStart(today()))<=$(today())"},
[Deliverable Status]={'Completed','Approved'},
[Deliverable Due to Date] = {1}>}
[Deliverable _Key])
/
sum ({<[Deliverable Status]-={'Waived'},
[Deliverable Due to Date] = {1}>} [Deliverable Due to Date])
It says there is an error in the Set modifier function, can someone help me? If the statement of the code is unclear please let me know!
best,
AS
You can try Date={">=$(=YearStart(today()))<=$(today())"}instead of today()={">=$(=YearStart(today()))<=$(today())"} as the left side of the equal sign has to be a field, not a function.
JG
Hey Juan,
Thanks for your support!
The problem is it shows the data from 2018 till 2021 but I need only from Jan 2021 till present. Also, there is not field as Date() in the system, will your code still work?
Can you share the full code too? Thanks!
Best,
AS
Hope you've any date field in your data model inorder to derive Year, Month, Quarter, Week etc. In that case, you can change the expression like below
num(
count(
{<
Year=,Month=,Quarter=,DateField={">=$(=Date(YearStart(today()),'YourDateFormat'))<=$(=Date(today(),'YourDateFormat'))"},
[Deliverable Status]={'Completed','Approved'},
[Deliverable Due to Date] = {1}>}
[Deliverable _Key])
/
sum ({<[Deliverable Status]-={'Waived'},Year=,Month=,Quarter=,DateField={">=$(=Date(YearStart(today()),'YourDateFormat'))<=$(=Date(today(),'YourDateFormat'))"},[Deliverable Due to Date] = {1}>} [Deliverable Due to Date])