Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
danipudianto
Contributor
Contributor

How to make expression with constant value base on dimension required ?

Dear All,

I has data like that

load * Inline

[LINI1,TAHUN1,BULAN1,JNS1,QTY1

DISK,2017,10,NG,2

DISK,2017,10,NG,4

DISK,2017,10,NG,1

DISK,2017,10,PROD,150

DISK,2017,10,REP,10

RIM,2017,10,NG,2

RIM,2017,10,NG,1

RIM,2017,10,PROD,170

RIM,2017,10,REP,11

];

How to fill expression PROD   value QTY based on LINI1 and JNS1='PROD' in all records

See picture below

Regards

Dani

A.JPG

7 Replies
PrashantSangle

Aggr(max({<JNS1={'PROD'}>}Qty),LINI1)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
tresesco
MVP
MVP

Sum(total <LINI1> {<JNS1={'PROD'}>}QTY1)

Capture.JPG

danipudianto
Contributor
Contributor
Author

Dear Tresesco,

It's Work. Thanks

PrashantSangle

another possible solution could be

max(TOTAL<LINI1>{<JNS1={'PROD'}>}QTY1)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
danipudianto
Contributor
Contributor
Author

Dear Prashant,

It's work for column %

It's Okay

Thanks

tresesco
MVP
MVP

Yes, 'in this case'. But what if there were multiple values in LINI1 with 'PROD' JNS1 ? Sum() and Max() aren't same right?  danipudianto‌ , please close the thread by marking correct/helpful the right replies.

PrashantSangle

Yes you are correct Tresesco. when there are multiple values for LINI1 with PROD JNS1 then sum() and max() will evaluate differently

Solution will completely depends on how user want the data..

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂