Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

SET expression after add month*30 chart 2 not working correctly ?

Hi All

I have SET expression for Table 1 is show correctly:-

=(Avg({$<year = {$(=max(year))}, month = {"$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2)/1000)

I have SET expression for chart 1 is show correctly:-

=(Avg({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2)/1000)

I have SET expression for Table 2 is show correctly:-

=(month+30*Avg({$<year = {$(=max(year))}, month = {"$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2)/1000)

I have SET expression for chart 2 is show not correctly result :-

=(month*30*Avg({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2)/1000)

May i know how to modify chart 2 expression , so that it can show correct result as table 2 ?

How to check ?

Step 1 click on step 1 button , you should note that Table 1 and Chart 1 and table 2 display correct value , and chart 2 show wrong value. because chart 2 dec should 593,000.9 is wrong , it should be show 49,428.7

Step 2 click on step 2 button , you should note that Table 1 and Chart 1 and table 2 display correct value , and chart 2 show wrong value. because chart 2 dec should 130,269.3 is wrong , it should be show 43,426.1

Paul

10 Replies
pokassov
Specialist
Specialist

Hi!

I looked into your expressions:

=(month*30*Avg({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2)/1000)

=(month+30*Avg({$<year = {$(=max(year))}, month = {"$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2)/1000)

Is it correct?

paulyeo11
Master
Master
Author

Hi Sir

Yes it correct when i click on step 2 , but when click on step 1 , i need it display in line chart , to display the trend line, it does not appear.

Paul

pokassov
Specialist
Specialist

I have no idea why you expected the same value if you had multiplied the same expression by month. 3 and 12 for your steps.

Sergey

Not applicable

Hi..

try once

=(month+"30*",Avg({$<year = {$(=max(year))}, month = {"$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2)/1000)

paulyeo11
Master
Master
Author

Hi Cep 

My table 2 give me correct result. When I click on step button . And I try to make my table 2 display in chart. 

Hope you understand now.

Paul

Sent from Samsung Mobile

paulyeo11
Master
Master
Author

Hi Screen

Thank you for your code. I try it got syntax error. It is possible give the file if you solve my problem. 

Paul

Sent from Samsung Mobile

pokassov
Specialist
Specialist

In table 2 you do this " month+ "

instead of chart 2, where you do this " month* "

paulyeo11
Master
Master
Author

Hi Cep 

Only chart 2 have problem. The rest of the table and chart are okay.

May I know why you ask me modify Table 2 expression ?

Paul

Sent from Samsung Mobile

pokassov
Specialist
Specialist

No. I ask  you change chart 2 expression. from month* to month+