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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart Set Analysis not working when emailing

I have code behind a button that does the follow:

1) Selected the current Year

2) Select the current Month

3) Selects the email recipient

4) Export a chart to excel

5) Emails the excel file the user.

All works, however, the YTD set analysis portion of the chart does not reflect YTD data in the email (or on the chart).

However, if I select everything manually (ie not through the button) the YTD set analysis portion of the chart is calculates acurately.

Any ideas what is happening?

Stephen

3 Replies
mike_garcia
Specialist
Specialist

Hi,

What is the formula you are using for the set analysis portion? What Actions (or Macro?) does the button have?

Is it possible for you to post an example qvw?

Mike.

Miguel García
Qlik Expert, Author and Trainer
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I can only guess that the commands are being processed so fast that the chart is being exported before it's recalculated. If this is a macro, there is an API that takes care of it:

WaitForIdle - look it up in the API guide.

If you are doing it using Actions, - then I'm not sure you can force a pause to let all the charts recalculation prior to sending the e-mail. Just to verify the theory, try splitting the job into two buttons - first button applies selection, and the second button does the export and the e-mail part.

cheers,

Ask me about Qlik Sense Expert Class!
Not applicable
Author

Found my problem. There are two fields that represent the month, one is a number the other is the name of the month. My set analysis was looking the the number, when I changed it to look at the name it worked.

It didn't look like I needed the WaitForIdle API but I did add it after the "selection"part of the code as it does process fast.

Thanks,
Stephen