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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Karim_Khan
Creator III
Creator III

Can we use If and sum statment in same expression

Hi Team,

      Can we use If and sum statment in same expression.I am trying to calculate the belwo expression into single statment but unable to achive the same.

Dimenssion:

=if([Entry Pages] <>'adsk:en:home' and [Entry Pages] <>'adsk:en_gb:404',[Entry Pages],Null())

Expression:

=sum(Visits)

If I will use only =sum(Visits) then it will give me the sum of value  along with Junk character.

But I don't want Junk character in my calculation so I used the belwo set analysis in dimenssion

=if([Entry Pages] <>'adsk:en:home' and [Entry Pages] <>'adsk:en_gb:404',[Entry Pages],Null())


But I want to handle the both set analysis calculation in single expression.


Regards,

KK


MRKachhiaIMPjagangwassenaarKush141087

KK
1 Solution

Accepted Solutions
Anonymous
Not applicable

try this Expression

=sum({<([Entry Pages]-={'adsk:en:home','adsk:en_gb:404'}>}Visits)

View solution in original post

6 Replies
Anonymous
Not applicable

try this Expression

=sum({<([Entry Pages]-={'adsk:en:home','adsk:en_gb:404'}>}Visits)

alexandros17
Partner - Champion III
Partner - Champion III

The logig shoul be something like:

Sum(If(cond=true, MyField, 0))

cspencer3
Creator II
Creator II

you should just be able to do:

Sum(

     if([Entry Pages] <>'adsk:en:home' and [Entry Pages] <>'adsk:en_gb:404',[Entry Pages] )

)


Also, this is not set analysis. Just IF logic.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

=Count({<[Entry Pages] -= {'adsk:en:home', 'adsk:en_gb:404'}>} Distinct Visits)


Hope this helps you.


Regards,

Jagan.

Karim_Khan
Creator III
Creator III
Author

Tnx a lot

KK
Karim_Khan
Creator III
Creator III
Author

Tnx a lot

KK