Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
nesonica
New Contributor III

Counting Field - Typing Error

Hi guys,

this formula seems not to work and I do not find my error. I was trying to count those orders where there is only one order position. Can you help me? 🙂 Thanks in advance!

Count({<PeriodMath={'>=$(vMinPeriodYear2)<=$(vMaxPeriod2)'},Sum(Count(POSITIONNUMBER)={1})>}ORDERNUMBER)

Labels (3)
1 Solution

Accepted Solutions
jaibau1993
Contributor II

Re: Counting Field - Typing Error

Hi!

In set analysis you have to  write sets for fields in your data model. You can not use

Sum(Count(POSITIONNUMBER)={1}

because "Sum(Count(POSITIONNUMBER)" is not a field. You may use something like

Count({<PeriodMath={'>=$(vMinPeriodYear2)<=$(vMaxPeriod2)'}, ORDERNUMBER = {"=Count(POSITIONNUMBER) = 1"})>} ORDERNUMBER)

Hope it helps!

Jaime.

2 Replies
jaibau1993
Contributor II

Re: Counting Field - Typing Error

Hi!

In set analysis you have to  write sets for fields in your data model. You can not use

Sum(Count(POSITIONNUMBER)={1}

because "Sum(Count(POSITIONNUMBER)" is not a field. You may use something like

Count({<PeriodMath={'>=$(vMinPeriodYear2)<=$(vMaxPeriod2)'}, ORDERNUMBER = {"=Count(POSITIONNUMBER) = 1"})>} ORDERNUMBER)

Hope it helps!

Jaime.

nesonica
New Contributor III

Re: Counting Field - Typing Error

Thanks so much! 😄 That worked