Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

Set Analysis Help Needed

Hi Team,

 

I have  EID,Date(multiple months) and TeamCode.

 

If i want to check if TeamCode or that EID for that month is same as previous or mentioned month , how do i do it in set anlaysis.

I want count of those EID, whose teamcode for that month is not same as previous/variable month.

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Set Analysis Help Needed

That is a shame, as adding a counter to a table can make all your charts and tables much more efficient in the front end application. The code above though could be rewritten to use a COUNT function instead:

count({<Month*={'$(vThisMonth')},TeamCode-={'$(=maxstring({<Month={'$(vPriorMonth)'}>}TeamCode))'}>}EID)

That should do it.

View solution in original post

6 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Set Analysis Help Needed

I would create variables for This Month and Prior Month, and add a counter (1 as EIDCount) in the load.

Then it would be something like:

sum({<Month*={'$(vThisMonth')},TeamCode-={'$(=maxstring({<Month={'$(vPriorMonth)'}>}TeamCode))'}>}EIDCount)

Getting the format of the Month correct in the variables (using Date()) is critical.

Hope that helps.

Highlighted
Contributor II
Contributor II

Re: Set Analysis Help Needed

Steve can you explain us what is the purpose of Month*

Highlighted
MVP & Luminary
MVP & Luminary

Re: Set Analysis Help Needed

Using *= in set analysis, rather than just = means that the current selection is taken into account for that filter, rather than ignoring the users selection. This makes for a much more intuitive experience for the user.

I wrote a blog post on the differences between the two approaches that you may find interesting:

https://www.quickintelligence.co.uk/qlik-set-analysis-star-equals/

Cheers,

Steve

Highlighted
Contributor II
Contributor II

Re: Set Analysis Help Needed

Thank you Steve....as always inspiring 🙂

Highlighted
Specialist
Specialist

Re: Set Analysis Help Needed

Hi Steve,

 

 

I dont have flexibility to change anything in the script. Need to do in UI only

Highlighted
MVP & Luminary
MVP & Luminary

Re: Set Analysis Help Needed

That is a shame, as adding a counter to a table can make all your charts and tables much more efficient in the front end application. The code above though could be rewritten to use a COUNT function instead:

count({<Month*={'$(vThisMonth')},TeamCode-={'$(=maxstring({<Month={'$(vPriorMonth)'}>}TeamCode))'}>}EID)

That should do it.

View solution in original post