Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

aggregation

I have a

table:

load

SerialNumber,

testType,

testCode

from.....

vTotalCount=Count({<TEST_TYPE={'A'}>}SERIAL_NUMBER)+Count({<TEST_TYPE={'B'}>}SERIAL_NUMBER)+Count({<TEST_TYPE={'C'}>}SERIAL_NUMBER)

When I am trying to do count(if(testType='A',SerialNumber)/$(vTotalCount)

and selected number and percentage options in number tab in the mekko chart. But I am seeing weird results. Don't know why

5 Replies
Highlighted

Try this

vTotalCount = Count( {<TEST_TYPE={'A','B','C'}>} SERIAL_NUMBER )


Or


vTotalCount = Count( TOTAL {<TEST_TYPE={'A','B','C'}>} SERIAL_NUMBER )



And this

=count( if ( testType = 'A',SerialNumber ) ) / $(vTotalCount)


Highlighted

OR direct expression writing with no use of variable

=Count( if ( TEST_TYPE = 'A', SerialNumber ) )

/

Count( {<TEST_TYPE={'A','B','C'}>} SERIAL_NUMBER )

Or

=NUM( Count( if ( TEST_TYPE = 'A', SerialNumber ) )

/

Count( {<TEST_TYPE={'A','B','C'}>} SERIAL_NUMBER ) ,'#,##0%')

Or If you have all TEST_TYPE

=NUM( Count( if ( TEST_TYPE = 'A', SerialNumber ) )

/

Count( {<TEST_TYPE={*}>} SERIAL_NUMBER ) ,'#,##0%')

Highlighted
Not applicable

Hi Anand,

Thank you.

I need some thing like

=NUM( Count( if ( TEST_TYPE = 'A', SerialNumber ) )

/

Count( {<TEST_TYPE={*}>} SERIAL_NUMBER ) ,'#,##0%')


but this expression is not working

Highlighted
Specialist
Specialist

try this

=NUM( Count( if ( TEST_TYPE = 'A', SerialNumber ) )

/

Count( {1<TEST_TYPE={*}>} SERIAL_NUMBER ) ,'#,##0%')

Highlighted

Share sample data or may be but it should be working because at my end it is working

=NUM( Count( if ( TEST_TYPE = 'A', SerialNumber ) )

/

Count(TOTAL {<TEST_TYPE={*}>} SERIAL_NUMBER ) ,'#,##0%')



Or


=NUM( Count( if ( TEST_TYPE = 'A', SerialNumber ) )

/

Count(ALL {<TEST_TYPE={*}>} SERIAL_NUMBER ) ,'#,##0%')