Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a function in an expression which gives me the correct values in a pivot chart.
Is it possible to change this to a variable and then reference the variable in the chart? The syntax is below:
=
fieldvalue( 'Description', if([End Date]-[Start Date]=1,1,if([End Date]-AddMonths([Start Date],1)<0,2,if([End Date]-AddMonths([Start Date],3)<0,3,if([End Date]-AddMonths([Start Date],3)<0,4,5)))) )
Is it possible to then use this in a laod script as well? Start date and End dates are aliases as I am loading a csv file. Description is a field in another table.
I create variables in the load script like:
SET vBlueDC = '[DEBIT CODE] = 8036 or [DEBIT CODE] = 1100 or ([DEBIT CODE] >= 4100 and [DEBIT CODE] <= 4109)';
then reference it in the script like this:
if ($(vBlueDC), 'Blue' ,
I also create variables like this in the script:
SET vPartStdDisc = if ([Line Type] = 'P',
if (vRqdOrFull=0, round(([Reqd Qty]*Qty)*(([Std Retail Price]/[Pack Size])*((100 - [Addl Parts Disc%]) / 100)), 0.01),
round(ceil(([Reqd Qty]* Qty)/[Pack Size])*([Std Retail Price]*((100 - [Addl Parts Disc%]) / 100)), 0.01)), ;
which I can use in chart expressions like:
sum(
$(vPartStdDisc)
$(vLabStdDisc)
$(vMileStdDisc)
$(vTravelStdDisc)
0))))) * ((100 - [Order Disc%]) / 100)
Thanks that is great it works.
Is it possibel to set up a variable to accept a paramater? I am trying to format a field to a date so wold like to have a variable which you could pass start date or end date to.
Sorry I have messed it up now. I think that is was working before but doe snot do so anymore. I have a table with Product (in this exampl there is only one product) The Variable then uses start and end date, but if I only have product and the variable in the chart it only shows one item, whereas when I enter customer ID it shows the vlaue correctly. What do I need to do to show the chart with Product Nam eand then the grouings for the values returned by the variable?
Have got it workign again