Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
prahladind9
Partner - Contributor III
Partner - Contributor III

How to use 'and' 'or' '>'(greater than) in Set Analysis in a expression?

COUNT(if(CATEGORY = 'LIABILITY' AND DATESTART>=DATEPREVFINYEARSTART, CUSTOMERACCOUNTID))

I want to convert this expression into set analysis exp.

like count({$<CATEGORY = {'LIABILITY'}>}CUSTOMERACCOUNTID)

I don't know how to complete the expression.

Please help me out.

Thanks.

1 Solution

Accepted Solutions
sunny_talwar

May be try this:

Count({$<CATEGORY = {'LIABILITY'}, CUSTOMERACCOUNTID = {"=DATESTART >= DATEPREVFINYEARSTART"}>} CUSTOMERACCOUNTID)

View solution in original post

13 Replies
sunny_talwar

May be try this:

Count({$<CATEGORY = {'LIABILITY'}, CUSTOMERACCOUNTID = {"=DATESTART >= DATEPREVFINYEARSTART"}>} CUSTOMERACCOUNTID)

prahladind9
Partner - Contributor III
Partner - Contributor III
Author

Thanks a lot Sunny

Can you help me with these, I tried using your clue, but it doesn't work without sum,count...

if(APPLICATIONDATE = DATESTART,MODULE) and this expression is for Dimensions.

({$<MODULE = { "=APPLICATIONDATE = DATESTART"}>} MODULE) --- won't work

---------------------------------------------------------------------------------

If( MODULE <> 'LOANS'

and Date(DATEDORMANT) >= Date(APPLICATIONDATE)

and (Date(DATEDORMANT) - Date(APPLICATIONDATE)) <= NextXDays

,Date(DATEDORMANT))

sunny_talwar

Do you expect to see only a single value for MODULE? if you do, you can try this:

Only({$<MODULE = { "=APPLICATIONDATE = DATESTART"}>} MODULE)

prahladind9
Partner - Contributor III
Partner - Contributor III
Author

No, I want to see all values picked by date.

sunny_talwar

Do you have a sample you can share to see what the input is and what the required output is?

prahladind9
Partner - Contributor III
Partner - Contributor III
Author

Please go through the attachement

sunny_talwar

I don't see this as your dimension -> if(APPLICATIONDATE = DATESTART,MODULE). Instead I see -> if(APPLICATIONDATE = DATESTART, PRODUCTBUSINESS). Would you be able to guide me on what exactly are you trying to convert to set analysis. Is the result from your current if statement working for you?

prahladind9
Partner - Contributor III
Partner - Contributor III
Author

Sorry, if(APPLICATIONDATE = DATESTART, PRODUCTBUSINESS) is the one I'm using for the sheet.

Yes, it is working for me. I want that 'if' statement to be in set analysis format for.

One more thing can we define Set analysis for dimension?

 

sunny_talwar

We can define set analysis for a dimension, but I would rather suggest you to do it in your expression because calculated dimensions are resource intensive. Even this if statement calculated dimension can be taken to the script to create a new field. Using a field as a dimension instead of a calculation is almost always advisable (if possible)