Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am new to QlikSense. I need to calculate the unique count of variables in a table/column. For e.g.
Exit Type | Month | Location |
---|---|---|
Voluntary | January | Pune |
Involuntary | January | Pune |
Voluntary | February | Bangalore |
Now I need to calculate = (Total number of Volunatry cases)/(Total number of Volunatry cases+Total number of Involunatry cases)
Thanks
Anurag Gupta
Hi Anurag,
Try using set analysis in one of the measures of the table.
Example:
Count({<Type={'Volunatry'}>} ID_Field) / Count({<Type={'Volunatry','Involunatry'}>} ID_Field)
Hi Sean,
Thanks for your suggestion.
Can you please help me understand ID_Field ? What is the pupose of this ?
Regards
Anurag
Basically the ID_Field represents a unique key field from the application's data model. From my set analysis syntax above, this is the item that gets counted. You can replace the ID_Field text with any other field you'd like.
Cheers,
Sean
HI Sean,
I have used follwing expression.
Count({<Type={'Volunatry'}>} [Exit Type]) / Count({<Type={'Volunatry','Involunatry'}>} [Exit Type])
This is showing error.
Am I iunderstanding it correct - : ID_Field is the column name ?
Does 'Type' has any significance ?
Regards
Anurag
Both Type and ID_Field names in the expression should be replaced with the appropriate column names from your data model. Hope that helps!
Here is also a fantastic post from QlikCommunity that goes over the set analysis syntax.