Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Rds
Contributor
Contributor

Calculation of multiple vales in same row

Hi all,

How can i calculate below

Row 1 -  a:b:c

Row 2-  a:b

Row 3-  a:c

Report shud show based on : as a delimiter

A- 3

B-2

C-2

 

Can this calculation be done using QlikSense.

Regards,

Rds

Labels (1)
3 Replies
hic
Former Employee
Former Employee

Load your data using the script below:

Load
SubField(Field,':') as SubField,
Field
Inline
[Field
a:b:c
a:b
a:c];

Then make a chart with
Dimension: SubField
Measure: Count(SubField)

Rds
Contributor
Contributor
Author

Thanks for reverting. but i dont think subfield can be used as sequence of the value is not fixed, so whether a value will be first in sequence of a third value like "c" can be 3rd value - a,b,c or can be first value c.

I think for resolving this INSTR or substr type function need to be used in Qliksense. Soa value nees to be searched everytime in the string of concatenated values in every cell.

Really appreciate your help.

RDS

MarcoWedel

Can you please clarify how your expected result differs from Henric's solution, as it delivers exactly what you initially seemed to describe?

MarcoWedel_0-1655148680547.png


please refer to 
https://help.qlik.com/en-US/sense/May2022/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions...
for a description of how the two parameter version of the SubField() function works:

MarcoWedel_1-1655148726988.png

 

hope this helps
Marco