Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
robertocesp
Creator II
Creator II

Help with an expression?

Hi,

I have the following expression that I need to understand, can you please let me know what do mean each section:

= Count(Aggr(Only({$<ID = e({<[Closure Code]={'wrong module','Transferred to new module'}>})>} [Case Count]), AutoID))

I know that the on red are fields, but I need to know what does the blue words/letters. I need to add exclusions for other fields, can I just add a coma and will work?

Please advise.

1 Solution

Accepted Solutions
robertocesp
Creator II
Creator II
Author

I think that I found the issue, the problem is with the data and not with the expressions that you provided me. I am working on improve the way that I filling qlikview. If I have problems again I will ping you.

Thanks

View solution in original post

40 Replies
sunny_talwar

This is basically saying that Count DISTINCT Case Count per AutoID where a particular id doesn't have Closure Code as wrong module or transferred to new module.

and yes, to add more exclusions you need to add them in the list separated by comma

robertocesp
Creator II
Creator II
Author

The problem is that instead of decreasing the numbers are increasing them. :S

Do you know another way to do it, to see if I get the same results?

sunny_talwar

Difficult to say without looking at a sample? Can you provide some sample data with the expected output?

robertocesp
Creator II
Creator II
Author

Cannot provide a lot of information, however this is the original calculation:

= Count(Aggr(Only({$<ID = e({<[Closure Code]={wrong module','Transferred to a new module'}>})>} [Case Count]), AutoID))

Then, I update as the following to get what I though a new filter will decrease the number, but happened the opposite:

=Count(Aggr(Only({$<CustomID = e({<[Closure Code]={'wrong module','Transferred to a new module'},[State] = {'Pre','Invalid'}>})>} [Case Count]), AutoID))

I have noticed that the ID won't relate the fields Closure Code or State, so I use another field that relates both fields. But I am getting extra records.

I need to count distinct all records that aren't wrong module, transferred to a new module, or with the state on Pre or invalid.

Can you help me with a expression that can do something like that?

neelamsaroha157
Specialist II
Specialist II

what results are you getting with below expression

= Count(Aggr(Only({$<ID = e({<[Closure Code]={wrong module','Transferred to a new module'}>}),[State] = {'Pre','Invalid'}>} [Case Count]),AutoID))

robertocesp
Creator II
Creator II
Author

I am getting  more records that the one without the state field. That's why I am thinking it's not working well. Because should exclude both.

neelamsaroha157
Specialist II
Specialist II

Try this

= Count(Aggr(Only({$<ID = e({<[Closure Code]={wrong module','Transferred to a new module'}>}),[State] -= {'Pre','Invalid'}>} [Case Count]),AutoID))

robertocesp
Creator II
Creator II
Author

I did, didn't work, if I uses only one condition inside the e() it works, but when I add the ',' and the second field it excluded both conditions

robertocesp
Creator II
Creator II
Author

Any idea on how to have 2 exclusions in one expression? when I have added the second field none of the exclusions worked.