15 Replies Latest reply: Apr 25, 2017 12:28 AM by Rahul Pawar

# how to write expressions

hello,let say i have date like below

supplier        parts            value

A                  ice                  100

B                  ice                  200

C                  ice                  300

D                  ice                  400

J                chemical            200

L                sugar                500

M                sugar              1000

...............................

...............................

.................. so on

let say i got thousands of supplier

i want to display only those parts which  has been supplier by more then one Supplier and i want to show % of that particular supplier among other supplier who supplies same parts.i mean

supplier          part              value            %of that supplier

A                  ice                  100                      100/100+200+300+400

B                  ice                  200                      200/100+200+300+400

C                  ice                  300                      300/100+200+300+400

D                  ice                  400                      400/100+200+300+400

L                sugar                500                        500/1000+500

M                sugar              1000                      1000/1000+500

Note :i dont want to display chemical because it is supplied by only one supplier

so what expressions do i need write

I tried this in calculated dimension to display only those parts which has multiple supplier

1)

if(count(distinct supplier)>1,part)  (Invalid dimension error)

2)%of that supplier

sum(%of that supplier)/sum(total %of that supplier)

which is also wrong

how to write this expressions

Thanks

Naveen

• ###### Re: how to write expressions

Any suggestions how to write calculate dimension plz.....

• ###### Re: how to write expressions

Hello Navin,

Trust that you are doing great!

Regards!

Rahul

• ###### Re: how to write expressions

sorry i have personal addition ,i wont be able to open ur file ,will u please copy paste for me.....

• ###### Re: how to write expressions

Hello Navin,

```//value
If(Count(TOTAL <parts> supplier)>1,Sum(value))

//%of that supplier
If(Count(TOTAL <parts> supplier)>1, Sum(value) / Sum(TOTAL <parts> value))
```

Regards!

Rahul

• ###### Re: how to write expressions

when  i tried ur expression with sample data in qlikview i am getting perfect output,

but when i put same expression with my orginal data in qliksense i am not getting same output.

if u can help me more i can attach my qvf file if u send ur mail id , i cant share it on community . please

• ###### Re: how to write expressions

Thank you for validating the same.

My email address is  - rahulpawarb@gmail.com

Regards!

Rahul

• ###### Re: how to write expressions

Hello Rahul,

have u checked ur mail box ,have u gone through my qvf .....any clue bro

• ###### Re: how to write expressions

Hello Naveen,

Extremely sorry brother. Yesterday I left office early. Please see my response on your email. Deselecting the show zero values option present under the Add-ons - Data handling section of table object will give you desired results.

Please let me know if this is not expected response.

Regards!

Rahul

• ###### Re: how to write expressions

Hello Rahul,

• ###### Re: how to write expressions

Cheers,

Rahul

• ###### Re: how to write expressions

Expression:

=if(count(distinct supplier)>=2,part)

• ###### Re: how to write expressions

May be you can use this?

(Sum({<parts = {'=Count(parts)>1'}>}value)  / Sum(TOTAL <parts> value))

• ###### Re: how to write expressions

i mean only to display part name which had more then one supplier

i tired this but no use

=if(count(distinct supplier)>=2,part)

• ###### Re: how to write expressions

What are you expecting? I got like below