Qlik Community

App Development

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

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
joshpinfoldold
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
joshpinfoldold
Contributor III
Contributor III
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
joshpinfoldold
Contributor III
Contributor III
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

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