Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Luben
Creator
Creator

Set analysis

Hello I need help converting the below IF statement to Set analysis;

COUNT(
DISTINCT IF(
Folder_Open_Date >=vstart_date AND
Folder_Open_Date <=vend_date AND
[Status]<>"V" AND [Status]<>"Void"

,[Claim]

,NULL
)

Thanks in Advance. 

1 Solution

Accepted Solutions
JGMDataAnalysis
Creator III
Creator III

Count(
              {<
                  [Folder_Open_Date] = {">='$(Vstart_date)' <='$(Vend_date)'"}
                 ,[Status] *= E({<[Status] = {V, Void}>})
              >}
                  Distinct [Claim]
)

View solution in original post

11 Replies
joaopaulo_delco
Partner - Creator III
Partner - Creator III

Hi @Luben !

      If the fields vstart_date and vend_date are variable you can try this:

Count(
{<Folder_Open_Date={">=$(vstart_date)"},Folder_Open_Date={"<=$(vend_date)"},Status-={'V'},Status-={"Void"}>}
Distinct Claim
)
Help users find answers! Don't forget to mark a solution that worked for you!
JGMDataAnalysis
Creator III
Creator III

Try with this...

Count(
      {<
        [Folder_Open_Date] = {">='$(vstart_date)' <='$(vend_date)'"}
       ,[Status] *= E({<[Status] = {V, Void}>})
      >}
        Distinct [Claim]
)

If it doesn't works, try removing the single quotes.

Luben
Creator
Creator
Author

Thanks Guy's for your response, i tired both approaches and get zero in my KPI 

 

JGMDataAnalysis
Creator III
Creator III

How the variables vstart_date and vend_date are defined?

Luben
Creator
Creator
Author

i have the like this 

Let Vend_date = today();
Let Vstart_date = AddMonths(MonthStart(Today()), -1);

JGMDataAnalysis
Creator III
Creator III

Count(
              {<
                  [Folder_Open_Date] = {">='$(Vstart_date)' <='$(Vend_date)'"}
                 ,[Status] *= E({<[Status] = {V, Void}>})
              >}
                  Distinct [Claim]
)

JGMDataAnalysis
Creator III
Creator III

The Vstart_date variable can be defined a bit more compactly...

LET Vstart_date = MonthStart(Today(), -1);

Luben
Creator
Creator
Author

 

Count(
              {<
                  [Folder_Open_Date] = {">='$(Vstart_date)' <='$(Vend_date)'"}
                 ,[Status] *= E({<[Status] = {V, Void}>})
              >}
                  Distinct [Claim]
)

Hello JGM I Tired the above and still getting zero in the KPI as seen below

Luben_0-1634821671574.png

 I used this as my variables

LET Vstart_date = MonthStart(Today(), -1);

Let Vend_date = today();

 

Digvijay_Singh

Can you share what do you see at the bottom of expression editor, the evaluated set expression appears over there, I guess something is wrong with the date format comparison in the set condition.