Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

constant values

hi all,

I have created a table which displays the stats of 30 days, 7 days etc...

metrics.png

In the above pic, 30/60 days variance is dependent on 3rd and 4th column. I am using the below expression:

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

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

  -

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

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

/

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

  client_id= {'20'}>} invitation_id)),

if(Metrics='Landing Page Hits',((count({$<CanonicalDate={">$(=date(Max(CanonicalDate)-30))<=$(=date(Max(CanonicalDate)))"}, DateType= {'accessed'},

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

  -

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

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

  /

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

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

Now i need to display 100% in the last column if the 3rd column value is zero.

How can i achieve this?

Regards,

Pramod

Tags (1)
1 Solution

Accepted Solutions

Re: constant values

Wrap an alt() around the expression: alt( ...your_expression_here... , 1)


talk is cheap, supply exceeds demand
3 Replies

Re: constant values

Wrap an alt() around the expression: alt( ...your_expression_here... , 1)


talk is cheap, supply exceeds demand
Not applicable

Re: constant values

Is what i am doing is correct?

Num(if(Metrics='Invitations',alt(((count({$<CanonicalDate={">$(=date(Max(CanonicalDate)-30))<=$(=date(Max(CanonicalDate)))"}, DateType= {'invitation'},

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

  -

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

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

/

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

  client_id= {'20'}>} invitation_id)),1)

I need to use alt for each expression right?

Not applicable

Re: constant values

Thanks It worked fine...