Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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
Highlighted
Contributor III
Contributor III

Re: Calculation within P()

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
Highlighted
Contributor III
Contributor III

Re: Calculation within P()

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

Highlighted
Contributor III
Contributor III

Re: Calculation within P()

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