Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Min() function in if() Condition

How can we use min() function inside if() condition.

The expression I m using is:

if((GetSelectedCount(Quarters)=0 and [Fiscal Year]=min([Fiscal Year])

Not working fine.

Kindly Help.

2 Replies
Highlighted
Creator III
Creator III

Hi Divyanshi,

I would recommend using a variable:

vMinFiscalYear as Min(FiscalYear)

Then using

if((GetSelectedCount(Quarters)=0 and [Fiscal Year]=$(vMinFiscalYear))



Hope this helps

Highlighted
Contributor III
Contributor III

If this expression is a condition, then you shouldn't use a dimension that have no a single value in all selections, try with only([Fiscal Year])=min([Fiscal Year]) or substringcount(concat(distinct [Fiscal Year],'|'),text(min([Fiscal Year])))>0 and so on. The conditional expression have to be dimensional sense. I hope this hint will be helpful.