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: 
paulyeo11
Master
Master

How to add one more condition to =if( [C_ONHAND_AMT]>1,[product code]) ?

Hi All


I have a table which is working fine.

I need to make the table only display those stock Number of Turn > 10

Now it display all stock Number of turn > 0.


My stock turn over expression :-


SUM(C_ONHAND_AMT)/sum(B_COGS)


My dimension expression now as below , working fine ::-


=if( [C_ONHAND_AMT]>1,[product code])


In order only list those stock Numberof turn >10


I need to add below expression to existing dimension expression  :-


SUM(C_ONHAND_AMT)/sum(B_COGS)>10


So the overall new expression for dimension should be :-


=if( [C_ONHAND_AMT]>1 and C_ONHAND_AMT/sum(B_COGS)>10,[product code])


But it does not work.


Paul



 

 

 

1 Solution

Accepted Solutions
Anil_Babu_Samineni

PFA

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

8 Replies
paulyeo11
Master
Master
Author

My Qvw

Anil_Babu_Samineni

Perhaps this in your measure?

Sum({<C_ONHAND_AMT = {'>1'}, [product code] = {"=SUM(C_ONHAND_AMT)/sum(B_COGS)>10"}>} COS)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

Hi Anil

Thank you for your fast reply.

it does not work.

i need to display the top 8 row .

I cannot set the max number = 8 , as other brand of listing is not top 8 row , it depend on ratio.

Paul

Anil_Babu_Samineni

PFA

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

Hi Anil

wow i see that you can control all the number very well.

May i know ,why filter by dimension for both condition it will not work ?

Anil_Babu_Samineni

I don't prefer Calc. Dimension due to performance in UI. Which is not a good practice. But we can force until unless not possible in set expression. Can you try this?

=if([C_ONHAND_AMT]>1 and Aggr((Sum(C_ONHAND_AMT)/sum(B_COGS)), [product code])>10, [product code])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulyeo11
Master
Master
Author

Hi Anil

Your Dimension expression work fine :-

=if([C_ONHAND_AMT]>1 and Aggr((Sum(C_ONHAND_AMT)/sum(B_COGS)), [product code])>10, [product code])

it also give me missing value.

it save me time a lot. i Prefer filter by dimension , easy to maintenance.

Paul Yeo

Anil_Babu_Samineni

Yes, Using calc. dimension nulls may produce. To get rid you have to suppress null value from Dimension ..

Best

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful