Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to write out the correct logic for an IF statement, but the syntax is incorrect, can anyone please shed some light as to what is wrong here please?
if(
count(Purchase_Volume) + $(v_Extra Volume) + (v_Product = 'DIST'), count(Purchase_Volume) + $(v_Extra Volume),
count(Purchase_Volume) + $(v_Extra Volume) + (v_Product = 'TUPA'), count(Purchase_Volume) + $(v_Extra Volume),
count(Purchase_Volume) + $(v_Extra Volume) + (v_Product = 'DGUTA'), count(Purchase_Volume) + $(v_Extra Volume)
,0)
what is v_product??? variable or field??
can you share defination of variable $(v_Extra Volume)
Regards,
Prashant Sangle
In response to your previous question, if you have product as a dimension in your table, the following should give you the behavior you were looking for:
count(Purchase_Amount)+if(Product=$(v_Product),$(v_Extra_Volume),0)
Note: depending on how you variable input is setup, you may need quotes:
count(Purchase_Amount)+if(Product='$(v_Product)',$(v_Extra_Volume),0)
Hi
v_Product is defined from the variable 'Product_Grouped'. I am using v_Product due to having this as a Variable Input Button.
Similar to v_Extra_Volume, this is also a Variable Input (Input Box).
The IF statement (I am hoping) will allow me to then key in 100 to the v_Extra_Volume input box, select v_product button, then my table will update based on these selections.
well if your both field are input variable. out of that 1 input variable is comparing for product name and another for extra volume,
and in all case you just want to add v_extra_volume + count(Purchase_Volume)
then why don't you just write
=v_extra_volume+count(Purchase_Volume)
Thanks for your suggestion Gary, the second option works syntax wise, but the increase still adds to all Products opposed to showing as a 0