Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
inam
Contributor III
Contributor III

formula in QlikView

Hello Community 🙂 ,

I want to convert 1 excel formula in QlikView I Tried  many times but not getting value .

Excel Formula :-  =IFERROR(1/COUNTIF([File No.],[@[File No.]]),0)

I Tried :- 1)  If(IsNull(Count({<[File No.] = {"$(= [File No.])"}>} [File No.])),0, 1/Count({<[File No.] = {"$(= [File No.])"}>} [File                                   No.])) as booking1,

                  2) IF(COUNT([File No.]) > 0, 1 / COUNT({< [File No.] = {"$(= [File No.])"} >}), 0) as booking1,

                 3)IF(LEN([File No.]) = 16,IF(COUNT(DISTINCT [File No.]) = 1,1 / COUNT({<[File No.] = {'$(= [File No.])'}>} DISTINCT                            [File No.]),0),0) as booking1,

 

my requirement:-

In this [File No.] field data coming duplicates also so for my requirement I want to satisfy 3 conditions

1)if [File No.] are distinct then count =1,

2) if Duplicates [File No.] are present 1/count [File No.] example 1/2=0.5,1/3=.0.3 ,1/4=.0.25....,

3) if not present [File No.] then put 0,

 

 

Labels (3)
1 Reply
Kushal_Chawda

@inam  you need to write the below expression

=alt(if(count(File No.])=1,1,1/count([File No.])),0)