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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
varunreddy
Creator III
Creator III

Can we use this in set analysis

Hi,

I am trying to convert this into set expression. Is there a way to do it?

 

if([Pull Type]='M' or [As of Date] = '$(vmaxDate)', [As of Date])

Cheers!

1 Solution

Accepted Solutions
sunny_talwar

If its your dimension, try this:

=Aggr(Only({<[Pull Type] = {'M'}> + <[As of Date] = {"$(=Date(Max([As of Date]), 'YourDateFieldFormat'))"}>} [As of Date]), [As of Date])

View solution in original post

20 Replies
sunny_talwar

May be this:

=Only({<[Pull Type] = {'M'}, [As of Date] = {"$(vmaxDate)"}>} [As of Date]) or

=Only({<[Pull Type] = {'M'}, [As of Date] = {"$(=vmaxDate)"}>} [As of Date])

varunreddy
Creator III
Creator III
Author

Sunny,

I tried this, but it didn't work, so came up with if syntax

sunny_talwar

Can you share a sample where it is not working? What is the expression for your variable vmaxDate? May be that is the issue.

varunreddy
Creator III
Creator III
Author

vmaxdate = max(Date)

Qrishna
Master
Master

Only({$<[Pull Type] = {'M'} + [As of Date] = {"$(vmaxDate)"}>} [As of Date]) 


edit:  The"+"-sign is used for OR in set analysis

sunny_talwar

Try this may be to find the max date where Pull Type = M

=Max({<[Pull Type] = {'M'}>} [As of Date])

Qrishna
Master
Master

I guess this expression returns the values  for [As of Date] where [Pull Type] = {'M'} and  [As of Date] = {"$(vmaxDate)"}

varunreddy
Creator III
Creator III
Author

I need Date where [Pull type] = 'M' or [As of Date] = max([As of Date])

Qrishna
Master
Master

try using

Only({$<[Pull Type] = {'M'} + [As of Date] = {"$(vmaxDate)"}>} [As of Date])