Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show value for current month

Hi All,

 

If I select FA-JV(Function= FA-JV)

 

Leverage is not showing current month value(201). It is showing 174. If I click on Quarter or moth it is showing correct values. Please find sample data.  (For FA-JV No Partner)

 

(Leverage= Partner to Professional ratio )

 

Requirement is if I select in FA-JV Leverage wil show current month(Feb)  FA-JV Head count and if I select Quarter or Month  it will show that Quarter or Month  FA-JV Head count like 0:201.( For FA-JV No Partner)

 

My Expression:

 

=if(Function='FA-JV',0&':'&Round(Avg(Aggr(Count(DISTINCT([Emp. Id])), Month))),
if(GetSelectedCount([Fiscal Quarter]) > 0,1&':'&Round((Round(Avg(Aggr(Count(DISTINCT([Emp. Id])), Month)))- Round(Avg(Aggr(Count({<Grade={'Partner'}>}DISTINCT([Emp. Id])), Month))))
/
Round(Avg(Aggr(Count({<Grade={'Partner'}>}DISTINCT([Emp. Id])), Month)))),
if(GetSelectedCount(Month)>0,1&':'&Round((Round(Avg(Aggr(Count(DISTINCT([Emp. Id])), Month)))- Count({<Grade={'Partner'}>}DISTINCT([Emp. Id])))/Count({<Grade={'Partner'}>}DISTINCT([Emp. Id]))),
1&':'&
Round((Count({<CDate = {'02/01/2016'}>}DISTINCT([Emp. Id]))- Count({<Grade={'Partner'},CDate = {'02/01/2016'}>}DISTINCT([Emp. Id])))/Count({<Grade={'Partner'},CDate = {'02/01/2016'}>}DISTINCT([Emp. Id])))
)))

 

Thanks,

Krishna.

1 Solution

Accepted Solutions
sunny_talwar

Not 100% certain, but does this give you a solution you are looking for:

=If(Function = 'FA-JV',0&':'& Round(Count(DISTINCT {<CDate = {"$(=Date(Max(CDate)))"}>} [Emp. Id])),

If(GetSelectedCount([Fiscal Quarter]) > 0, 1 & ':'& Round((Round(Avg(Aggr(Count(DISTINCT([Emp. Id])), Month)))- Round(Avg(Aggr(Count({<Grade={'Partner'}>}DISTINCT([Emp. Id])), Month))))

/Round(Avg(Aggr(Count({<Grade={'Partner'}>}DISTINCT([Emp. Id])), Month)))),

if(GetSelectedCount(Month)>0,1&':'&Round((Round(Avg(Aggr(Count(DISTINCT([Emp. Id])), Month)))- Count({<Grade={'Partner'}>}DISTINCT([Emp. Id])))/Count({<Grade={'Partner'}>}DISTINCT([Emp. Id]))),

1&':'&Round((Count({<CDate = {"$(=Date(Max(CDate)))"}>}DISTINCT([Emp. Id]))- Count({<Grade={'Partner'},CDate = {"$(=Date(Max(CDate)))"}>}DISTINCT([Emp. Id])))/Count({<Grade={'Partner'},CDate = {"$(=Date(Max(CDate)))"}>}DISTINCT([Emp. Id]))))))

View solution in original post

5 Replies
sunny_talwar

Not 100% certain, but does this give you a solution you are looking for:

=If(Function = 'FA-JV',0&':'& Round(Count(DISTINCT {<CDate = {"$(=Date(Max(CDate)))"}>} [Emp. Id])),

If(GetSelectedCount([Fiscal Quarter]) > 0, 1 & ':'& Round((Round(Avg(Aggr(Count(DISTINCT([Emp. Id])), Month)))- Round(Avg(Aggr(Count({<Grade={'Partner'}>}DISTINCT([Emp. Id])), Month))))

/Round(Avg(Aggr(Count({<Grade={'Partner'}>}DISTINCT([Emp. Id])), Month)))),

if(GetSelectedCount(Month)>0,1&':'&Round((Round(Avg(Aggr(Count(DISTINCT([Emp. Id])), Month)))- Count({<Grade={'Partner'}>}DISTINCT([Emp. Id])))/Count({<Grade={'Partner'}>}DISTINCT([Emp. Id]))),

1&':'&Round((Count({<CDate = {"$(=Date(Max(CDate)))"}>}DISTINCT([Emp. Id]))- Count({<Grade={'Partner'},CDate = {"$(=Date(Max(CDate)))"}>}DISTINCT([Emp. Id])))/Count({<Grade={'Partner'},CDate = {"$(=Date(Max(CDate)))"}>}DISTINCT([Emp. Id]))))))

qliksus
Specialist II
Specialist II

Hi,

It showing the values correctly  as you haven't filtered the current month its showing the average of all months as 174

 

Jan198
Feb201
Apr146
May148
Jun158
Jul162
Aug169
Sep168
Oct183
Nov191
Dec191
Average174.0909091

So if you want the current  month value for the selection you will have to change your expression like something below

Round(Avg(Aggr(Count({<Month={'$(CM)'}>}DISTINCT([Emp. Id])), Month)))

Anonymous
Not applicable
Author

Thanks Sunny.

kkkumar82
Specialist III
Specialist III

Sunny your are a real genious, appreciate you for your quick answers

sunny_talwar

I am glad that you think so Kumar