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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculation within P()

I've got a data island which I'm using as a date selection tool. I've got a set analysis which returns the average CSAT score for the selected month;

     avg({<Date_Year_Month=P(Reporting_Month)>} CSAT)

Date_Year_Month is in the master calendar and Reporting_Month is the un-linked data table. How would I combine =addmonths(Reporting_Month,-1) with the P function to show me the average CSAT for the previous month? I thought something like

     avg({<Date_Year_Month=P($(=AddMonths(Reporting_Month,-1)))>} CSAT)

but that doesn't do it. I've tried a handful of others and also referred to the help guide but without any luck.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Answer was;

avg({<feedback_id=P({<Date_Year_Month={'$(=Date(AddMonths(Reporting_Month,-1), 'YYYY-MMM'))'}>} feedback_id)>} CSAT)

If anyone can see how to improve that expression please let me know

View solution in original post

2 Replies
Anonymous
Not applicable
Author

I also have a unique id number for each CSAT which I thought it might be possible to use like;

     avg({$<feedback_id =P({1<Date_Year_Month={$(=addmonths(Reporting_Month,-1))}>}feedback_id)>}CSAT)

But still no luck

Anonymous
Not applicable
Author

Answer was;

avg({<feedback_id=P({<Date_Year_Month={'$(=Date(AddMonths(Reporting_Month,-1), 'YYYY-MMM'))'}>} feedback_id)>} CSAT)

If anyone can see how to improve that expression please let me know