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

Values is coming wrong when the date is taken in the table

Hello Everyone,

I did some calculation by using sum in the set analysis, i took date in the table and i took this calculations as expression.

When i select nothing the data is showing wrong, when i select the particular date, the data is coming correct,

Can you please tell me what would be the reason.

(sum({$<Year={'2011'}>}(measure1*measure2))/sum({$<Year={'2011'}>}measure2)*Count(days)/
(sum({$<Year={'2011'}>}(Measure3*Measure2))/(sum({$<Year={'2011'}>}Measure2*Count(days)))))*100


Thanks in advance

2 Replies
MK_QSL
MVP
MVP

use something like below

(sum({$<Year={'2011'}>}(measure1*measure2))/sum({$<Year={'2011'}>}measure2)*Count(days)/

(sum({$<Year={'2011'}>}(Measure3*Measure2))/(sum({$<Year={'2011'}>}Measure2*Count(days)))))*100


Instead of {'2011'} use any one from below

{'$(=Max(Year))'}

This will give you data corresponds to Max(Year) if not selected or Max(Year) if user selected any...

If you want 3 Years old data... something like if user select 2014, it will give 2011 data, use as below

{'$(=Max(Year)-3)'}

Hope this will help... if your problem is not sorted out using above, request you to upload your sample apps or at least a sample file...



Not applicable
Author

Could be misplaced brackets ?

Try this:

(sum({$<Year={'2011'}>}(measure1*measure2))/sum({$<Year={'2011'}>}measure2)*Count(days)/
(sum({$<Year={'2011'}>}(Measure3*Measure2))/(sum({$<Year={'2011'}>}Measure2)*Count(days))))*100