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: 
krmvacar
Creator II
Creator II

Qliksense Set expression add dimension calculatıon

Hi  All,

ı have straight table dimension like this

=if(statü like 'Ok' or ([statü like 'NoOk' and [Quality]>0),Type)

I want to dimension calculatıon add in set expression.

My set expression:

sum(
{<
[CompanyCode]={"1300"}, 
[MaterıalCode]={"A300"}, 
[TypeMaterıal]={"1","2","3"}
>-<
[Flag]={"X"},
[Group] ={"*Gal.Fas.Boy.Rlo"}
>}Sales)

 

Thank you so much

Labels (1)
1 Solution

Accepted Solutions
zar
Employee
Employee

Hi! Based on the provide information, one way to have it is like I mentioned below.

Considering the data:

DATA:
LOAD * INLINE [
statü, Quality, Type, CompanyCode, MaterıalCode, TypeMaterıal, Flag, Group, Sales
Ok,0,TYPE_A,1300,A300,1,Y,AAAA,20
NoOk,20,TYPE_B,1300,A300,2,Y,BBBB,30
NoOk,20,TYPE_B,1300,A300,2,X,AAA_Gal.Fas.Boy.Rlo,13
NoOk,0,TYPE_B,1300,A300,2,Y,BBBB,30
Ok,20,TYPE_A,1300,A400,1,Y,AAAA,22
Ok,30,TYPE_A,1300,A300,3,Y,AAAA,33
]
;

Only 3 rows highlighted in green in the screenshot are true for your conditions. 

 

Captura de pantalla 2024-10-08 a las 19.47.23.png

 

Settings for the table:

DimensionDimensionExpression (measure)Expression (measure)Expression screenshotExpression screenshot

Expression: 

=
{<[CompanyCode]={'1300'}
    ,[MaterıalCode]={'A300'}
    ,[TypeMaterıal]={'1','2','3'}
    ,[Flag]-={'X'}
    ,[Group]-={"*Gal.Fas.Boy.Rlo"}
>}
Sum(
{
 <[statü]={'Ok'}>
 +
 <[statü]={'NoOk'},Quality={">0"}>
 } 
Sales
)

View solution in original post

1 Reply
zar
Employee
Employee

Hi! Based on the provide information, one way to have it is like I mentioned below.

Considering the data:

DATA:
LOAD * INLINE [
statü, Quality, Type, CompanyCode, MaterıalCode, TypeMaterıal, Flag, Group, Sales
Ok,0,TYPE_A,1300,A300,1,Y,AAAA,20
NoOk,20,TYPE_B,1300,A300,2,Y,BBBB,30
NoOk,20,TYPE_B,1300,A300,2,X,AAA_Gal.Fas.Boy.Rlo,13
NoOk,0,TYPE_B,1300,A300,2,Y,BBBB,30
Ok,20,TYPE_A,1300,A400,1,Y,AAAA,22
Ok,30,TYPE_A,1300,A300,3,Y,AAAA,33
]
;

Only 3 rows highlighted in green in the screenshot are true for your conditions. 

 

Captura de pantalla 2024-10-08 a las 19.47.23.png

 

Settings for the table:

DimensionDimensionExpression (measure)Expression (measure)Expression screenshotExpression screenshot

Expression: 

=
{<[CompanyCode]={'1300'}
    ,[MaterıalCode]={'A300'}
    ,[TypeMaterıal]={'1','2','3'}
    ,[Flag]-={'X'}
    ,[Group]-={"*Gal.Fas.Boy.Rlo"}
>}
Sum(
{
 <[statü]={'Ok'}>
 +
 <[statü]={'NoOk'},Quality={">0"}>
 } 
Sales
)