Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
need to display in grid based on one the 2 valid
if (Pieces <> 0 , Pricetotal/Pieces) else (Grams <> 1 then Pricetotal/Grams)
Field names are ok formule gives error, so what do I wrong in syntax ?
also
if(Grams <> 0, sum(Pricetotal/Grams)),sum(Pricetotal/Pieces))
if not can you share a sample data and the expected output ?
Hello it works ok
just learned that i must be carefull with capitals , will not generate error, just will give nothing
This Grams should be grams then it works
thanks for helping out
if(Grams <> 0, sum(Pricetotal/Grams)),sum(Pricetotal/Pieces))
May be
=if(Pieces <>0,Pricetotal/Pieces,if(Grams <>1,Pricetotal/Grams))
Ok what I realize is that grams goes first allways, due sometimes in table it tells how many items in the total weight
this runs ok if(Grams <> 0, sum(Pricetotal/Grams))
But in case NO grams only pieces , how do i that behind ,
in VB I could work with something like
if(Grams <> 0, sum(Pricetotal/Grams)) else sum(Pricetotal/Pieces))
also
if(Grams <> 0, sum(Pricetotal/Grams)),sum(Pricetotal/Pieces))
if not can you share a sample data and the expected output ?
Hello , its simple i think ,
Grams is first choice, due to it could happen field Grams contains value And Pieces contains value
if Grams =0 then Pieces are counting
I my visual programs i have this
just do not know , and trying to find the syntax in Qlikview
If Grams <> 0 Then
Sum = Pricetotal / Grams
Else
Sum = Pricetotal / Pieces
End If
Hello it works ok
just learned that i must be carefull with capitals , will not generate error, just will give nothing
This Grams should be grams then it works
thanks for helping out
if(Grams <> 0, sum(Pricetotal/Grams)),sum(Pricetotal/Pieces))
You can also add Null check to this, if you want.
if(Grams <> 0 And Not IsNull(Grams), sum(Pricetotal/Grams)),sum(Pricetotal/Pieces))
thanks for tip