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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
waleeed_mahmood
Creator
Creator

Matching a Dimension in a Measure

Hello all,

I have a question i cant seem to figure out. I have a table like below:

I have PI column in a flat table dimension and i am trying to apply the following logic to get the desired output column in the table below:

Desired Output  Formula:

if(match(trim("PI"),'SN','NP','') AND NOT (isnull("F L1") OR trim("F L1")=''),
Avg(Aggr((sum(Future Sim L2 NP) -sum(C L2 NP))/sum(C L2 NP),[SAPM],"MPG")))

NOTE: There is more to this formula but if the first if statement doesnt work, rest isnt valid anyway.

Probelm:

My set analysis gets stuck at the Match(trim(PI),'SN',NP',' ') statement and i cant figure out why. If i remove the IF statement, the measure works fine. If i remove the Match statement, measure works fine. Why cant it find a match in that column when its its that in the text?

 

Please let me know if you need more information.

 

Thank you.

PIMPGSAPMF L1C L2 NPC L2 SPF L2 NPF L2 SPFuture Sim L2 NPFuture Sim L2 SPDESIRED OUTPUT
NPK46ES71950AA05180587 621 62110000005.79%
NPK46ES71950AA151,737.005,660.00 5,990.00 599010000005.83%
NPK46ES71950AA2514,698.0047,900.00 50,700.00 5070010000005.85%
NPK46ES71950AA3586,533.00282,000.00 299,000.00 29900010000006.03%
NPK46ES71950BD04110359 380 38010000005.85%
NPK46ES71950BD141,093.003,560.00 3,770.00 377010000005.90%
NPK46ES71950BD249,024.0029,400.00 31,100.00 3110010000005.78%
NPK46ES71950BD3435,615.00116,000.00 123,000.00 12300010000006.03%
NPK46ES71950BD447,200.0023,500.00 24,800.00 2480010000005.53%
NPK46ES71950BF0295310 328 32810000005.81%
NPK46ES71950BF128682,830.00 2,990.00 299010000005.65%
NPK46ES71950BF227,349.0024,000.00 25,400.00 2540010000005.83%
NPK46ES71950BF3242,078.00137,000.00 145,000.00 1450001000000

5.84%

10 Replies
chrismarlow
Specialist II
Specialist II

Glad you got it all sorted.