Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

percentage mis match

Hi all,

I am creating a below straight table.

percentage.png

To get the completion rate i am using below expression, and restricting to one decimal point.

prevoius month:

if(Metrics='Completions Rate',sum({$<CanonicalDate={">=$(=date(Max(CanonicalDate)-30))<$(=date(Max(CanonicalDate)))"}, DateType= {'completion'},

client_id = {'12'}>} course_completed)/

count({$<CanonicalDate={">=$(=date(Max(CanonicalDate)-30))<$(=date(Max(CanonicalDate)))"}, DateType= {'invitation'},

client_id = {'12'}>} invitation_id)),if(Metrics='Completions Rate','#,##0.0%', '#,##0'))

For MoM % change:

I am using the formula as

  1. (Current Month - Previous Month) / Current Month

while using in this formula i am not restricting to single decimal point. so i am getting -2.4%

but (5.6-5.5)/5.6 = -1.8% .

if(Metrics='Completions Rate',((sum({$<CanonicalDate={">=$(=date(Max(CanonicalDate)-30))<$(=date(Max(CanonicalDate)))"}, DateType= {'completion'},

client_id = {'12'}>} course_completed)/

count({$<CanonicalDate={">=$(=date(Max(CanonicalDate)-30))<$(=date(Max(CanonicalDate)))"}, DateType= {'invitation'},

client_id = {'12'}>} invitation_id))

-

(sum({$<CanonicalDate={">=$(=date(Max(CanonicalDate)-60))<$(=date(Max(CanonicalDate)-30))"}, DateType= {'completion'},

client_id = {'12'}>} course_completed)/

count({$<CanonicalDate={">=$(=date(Max(CanonicalDate)-60))<$(=date(Max(CanonicalDate)-30))"}, DateType= {'invitation'},

client_id = {'12'}>} invitation_id)))

/

(sum({$<CanonicalDate={">=$(=date(Max(CanonicalDate)-30))<$(=date(Max(CanonicalDate)))"}, DateType= {'completion'},

client_id = {'12'}>} course_completed)/

count({$<CanonicalDate={">=$(=date(Max(CanonicalDate)-30))<$(=date(Max(CanonicalDate)))"}, DateType= {'invitation'},

client_id = {'12'}>} invitation_id))

so what should i need to make changes to make -2.4% to match with -1.8%

Thanks,

Kumar

Tags (1)
1 Reply

Re: percentage mis match

No idea. Perhaps using the round function to make sure your expression isn't calculating with more precision than you expect. Can you post a small qlik sense app that illustrates the problem?


talk is cheap, supply exceeds demand