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: 
Nicolai_Mads
Partner - Contributor II
Partner - Contributor II

Dynamic set analysis

I am trying to limit a KPI object based on a dynamic date, e.g. Revenue CYTD. 

I have written the following script (with no error warnings), but I get a boring zero when applying it. 

Sum({<[Posting Date]={">=$(=Yearstart(Today())) < $(=today())"} >}[Revenue Amount])

Thanks in advance. 

 

 

 

 

Labels (2)
4 Replies
anat
Master
Master

can you check [Posting Date] field date format,it should be DD/MM/YYYY

canerkan
Partner - Creator III
Partner - Creator III

Hi Nicolai_Mads,

you could add the following to your Load Script to flag the Posting Dates needed:

Your_Table:

Load

*,

If(YearToDate([Posting Date]),1,0) as YTDflag

From...

 

and then use this in your set expression:

Sum({<YTDflag = {1}>}[Revenue Amount])

 

Let me know if it helped.

Regards,

Can

 

 

Nicolai_Mads
Partner - Contributor II
Partner - Contributor II
Author

The date format is DD-MM-Year. Not sure if that makes any difference? 

Nicolai_Mads
Partner - Contributor II
Partner - Contributor II
Author

Hi Canerkan, 

Thanks for your reply - I agree that it makes more sense to add to the load script editor instead of using a set analysis in the front-end to avoid having too many expressions decreasing performance. 

I did however discover that I could remove the end date (< $(=today())") as I only load realized revenue.