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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

if function in a countd

Hi all,

Im pretty new in qlikview and I wonder if you could help me?

I have some IDs and different date for each field. This is the case:

ID

IDType of account
a

1

a2
a7
a8
b1
b2
c7
d1
d7

So I want a table with the following rules:

Per each ID:

  • count distinct of Types of account - this I know how to create the field
  • If any of the ID has the Type of account 7.

Conclusion I would like to have:

IDCountd (types of account)Does it have Type of account ·7?
a4Yes
b2no
c1Yes
d2Yes

I look forward for your help Thanks!!

4 Replies
sunny_talwar

May be a straight table with

Dimension

ID

Expressions

Count(DISTINCT [Type of account])

If(Count(DISTINCT {<[Type of account] = {7}>} [Type of account]) > 0, 'Yes', 'No')

susovan
Partner - Specialist
Partner - Specialist

You can also try this,

1. =Count(ID)

2. =if((Aggr(if([Type of Account]='7','7','0'),ID,[Type of Account]))='0','No','Yes')

Output :

47.JPG

Warm Regards,
Susovan
pathiqvd
Creator III
Creator III

Hi,

     Check This,


Test:

LOAD * INLINE [

    ID, Dat

    a, 1

    a, 2

    a, 7

    a, 8

    b, 1

    b, 2

    c, 7

    d, 1

    d, 7

];

Dim:- Id

exp:-

1)count(Dat)

2)if(count({<Dat={'7'}>}Dat)>0,'Yes','No')

Anonymous
Not applicable
Author

Awesome ! I worked out

Do you have extra information about this toppic? I would like to learn more.

Muchas gracias a todos!! (thanks a lot to everyone !!)