Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a Field Like filter in set analysis

Guys,

is it possible to use a field like a filter in set analysis?

Example:

LOAD

* INLINE [ Field, Type, Value, Group

           'AA', 'Value',5, ''

           'BB', 'Value',6, ''

           'CC', 'Value',7, ''

           'T1', 'Total',0, 'AA,BB,CC'

           'DD', 'Value',8, ''          

           'EE', 'Value',9, ''          

           'FF', 'Value',10, ''                                

           'T2', 'Total',0, 'DD,EE,FF'];

I need that Field with Type equals "Total" behaves summarizing the values based in the Group Value Field.

My steps:

Variable: vSUM =Chr(39)&Replace(Group,',',Chr(39)&','&Chr(39))&Chr(39)

Expression in the chart

= if(Type = 'Total', Sum( TOTAL{$<Field = {$(vSUM)}> } Value), Sum(Value))

Follows the Qvw file

3 Replies
ecolomer
Master II
Master II

Can change the input file? or is necessary in this format?

MarcoWedel

Hi,

maybe one solution:

QlikCommunity_Thread_132221_Pic1.JPG.jpg

tabInput:

LOAD * INLINE [

    Field, Type, Value, Group

    AA, Value, 5,

    BB, Value, 6,

    CC, Value, 7,

    T1, Total, 0, "AA,BB,CC"

    DD, Value, 8,

    EE, Value, 9,

    FF, Value, 10,

    T2, Total, 0, "DD,EE,FF"

];

tabData:

LOAD Field,

    Value

Resident tabInput

Where Type='Value';

Left Join (tabData)

LOAD Field as Group,

    SubField(Group, ',') as Field

Resident tabInput

Where Type='Total';

DROP Table tabInput;

hope this helps

regards

Marco

Not applicable
Author

Marco,

I need the total be shown in a separate line, because it is pre configured.

Your solution is fine but for it to work i would need to transform my cloud.

i would like to use set analysis without transform the cloud

thanks