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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Generating counts in an expression

Hi gang - very new to Qlikview and need some simple (?) assistance

I have a status field in a fact table - based around email delivery (well - actually a StatusID - which links to a Dimension :))

The status field has a number of values e.g. 'sent', 'bounced','delivered','opened','clicked' etc.

I need to add an expression that does the following;

SUM(Opened) / SUM(Delivered)

This will give me an 'Opened %' for each Email campaign

Help please

Mark...

3 Replies
Not applicable
Author

Your expression it´s ok, just put as dimension a field has a status!!!!

Not applicable
Author

sorry - poor explantion from me

What is need is;

((Count(1) where [Email status] = 'Opened') / (Count(1) where [Email status] = 'Delivered'))

is probably a better explantion 🙂

oscar_ortiz
Partner - Specialist
Partner - Specialist

This is a crude solution, but you can try something like this.

Sum( if([Email Status] = 'Opened', 1, null()) ) / Sum( if([Email Status] = 'Delivered', 1, null()) )

Preferably I'd rather take care of that in the load script creating a counter for my "Devlivered" and "Opened".

if([Email Status] = 'Opened', 1, null()) ) as [Open Counter],

if([Email Status] = 'Delivered', 1, null()) ) as [Delivered Counter]

Then you can simplify your expression.

Sum([Open Counter]) / Sum([Delivered Counter])