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: 
rittermd
Master
Master

Set Analysis Help

This should be simple.  But I can't figure it out in Qlik Sense.

I have created an Inline table with 2 values for the Year (2015,2016).

I want to put Set Analysis on my charts to only show data where the Year of the field I am using is equal to the choice made from this listbox.  YearValue is the Inline table value from above (2015, etc.) that I created.

So far everything that I have tried is not working.

This is one example of something that I have tried:

Count({< Year(CreatedDateTime) = {$(YearValue)} >} IncidentNumber)

Any help would be greatly appreciated

1 Solution

Accepted Solutions
sunny_talwar

I would suggest creating Year field in the script and then use that in your set analysis:

LOAD CreatedDateTime,

          Year(CreatedDateTime) as YearField

FROM Source;

Count({<YearField = {$(YearValue)} >} IncidentNumber)


or

Count({<YearField = p(Year)} >} IncidentNumber)

Here Year is your Year field from Inline Table.

View solution in original post

6 Replies
sunny_talwar

I would suggest creating Year field in the script and then use that in your set analysis:

LOAD CreatedDateTime,

          Year(CreatedDateTime) as YearField

FROM Source;

Count({<YearField = {$(YearValue)} >} IncidentNumber)


or

Count({<YearField = p(Year)} >} IncidentNumber)

Here Year is your Year field from Inline Table.

rittermd
Master
Master
Author

Your expression does something.  But no data is being displayed in the chart.  I have verified the value in my inline table and also the new field created in the script.  The values are both 2015.

But nothing shows in the chart.

sunny_talwar

Have you created a year field in the script?

rittermd
Master
Master
Author

I created it and called it YearCreated

sunny_talwar

Would you be able to share a sample to take a look at?

rittermd
Master
Master
Author

I got it.

This works:

=Count({$<YearCreated={$(=YearValue)}>}IncidentNumber)

Thank you for your help