Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
markgraham123
Specialist
Specialist

conditional Set analysis

Hi Everyone,


I'm fetching count(Distinct(Awards) if name='John'.   count({$<Name={'John'}>} DISTINCT Awards)

I wanna restrict the year to 2015.

Can someone throw some limelight.

1 Solution

Accepted Solutions
Kushal_Chawda

Try this

Sum({<Year ={"$(=max(Year))"}>}[Units])/Count(Distinct{<Year ={"$(=max(Year))"}>}[routeNumber])

View solution in original post

9 Replies
sinanozdemir
Specialist III
Specialist III

Try something like this:

count({$<Name={'John'}, Year = {2015}>} DISTINCT Awards)

Kushal_Chawda

try,

count({$<Name={'John'}, Year ={"$(=max(Year))"}>} DISTINCT Awards)

markgraham123
Specialist
Specialist
Author

Thanq Sinan.

markgraham123
Specialist
Specialist
Author

Thanq Kush.

both of the solutions worked

markgraham123
Specialist
Specialist
Author

Hi,

I wanna calculate the below expression using set analysis for year 2015 like


(Sum([Units])/Count(Distinct([route Number])))

If (Year=2015, (Sum([Units])/Count(Distinct([routeNumber]))))

Can you help me in the syntax pls.

Kushal_Chawda

Try this

Sum({<Year ={"$(=max(Year))"}>}[Units])/Count(Distinct{<Year ={"$(=max(Year))"}>}[routeNumber])

markgraham123
Specialist
Specialist
Author

Thanq Kush.

sasiparupudi1
Master III
Master III

Sum({<Year={2015}>}[Units])/Count({<Year={2015}>}Distinct([route Number]))

Kushal_Chawda

Welcome Mark