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: 
Nagaraj6
Contributor II
Contributor II

If function not working

Hello Guys,

I need one help

I am converting Excel formula to Qlikview Expression but it is not working please help me out.

Excel formula:

=IFERROR(1/COUNTIF([File No.],[@[File No.]]),0)

Qlikview Formula converted:

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

 

This formula's are not working.

Labels (1)
2 Replies
Chanty4u
MVP
MVP

Try this s

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

 

Nagaraj6
Contributor II
Contributor II
Author

@Chanty4u  Thank you for giving reply,

above script is not  working.

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.N0 are present 1/count (Fiel No)  example 1/2=0.5,1/3=.0.3 ,1/4=.0.25....,

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

Below formula is not working.

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

 

expected output:

Nagaraj6_0-1684993638530.png